Changed __config to react to all of clang's currently documented has_feature flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@113086 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2010-09-04 23:28:19 +00:00
parent 04acacadca
commit 73d21a4f07
404 changed files with 1688 additions and 1557 deletions

View File

@@ -58,7 +58,7 @@ int main()
{
std::auto_ptr<A> ptr(new A);
A* raw_ptr = ptr.get();
#ifdef _LIBCPP_MOVE
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
std::shared_ptr<B> p(std::move(ptr));
#else
std::shared_ptr<B> p(ptr);
@@ -76,7 +76,7 @@ int main()
throw_next = true;
try
{
#ifdef _LIBCPP_MOVE
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
std::shared_ptr<B> p(std::move(ptr));
#else
std::shared_ptr<B> p(ptr);

View File

@@ -66,24 +66,24 @@ int main()
std::shared_ptr<B> pB(std::move(pA));
assert(B::count == 1);
assert(A::count == 1);
#ifdef _LIBCPP_MOVE
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
assert(pB.use_count() == 1);
assert(pA.use_count() == 0);
#else // _LIBCPP_MOVE
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
assert(pB.use_count() == 2);
assert(pA.use_count() == 2);
#endif // _LIBCPP_MOVE
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
assert(p == pB.get());
}
#ifdef _LIBCPP_MOVE
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
assert(pA.use_count() == 0);
assert(B::count == 0);
assert(A::count == 0);
#else // _LIBCPP_MOVE
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
assert(pA.use_count() == 1);
assert(B::count == 1);
assert(A::count == 1);
#endif // _LIBCPP_MOVE
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
assert(B::count == 0);
assert(A::count == 0);

View File

@@ -37,22 +37,22 @@ int main()
A* p = pA.get();
std::shared_ptr<A> pA2(std::move(pA));
assert(A::count == 1);
#ifdef _LIBCPP_MOVE
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
assert(pA.use_count() == 0);
assert(pA2.use_count() == 1);
#else // _LIBCPP_MOVE
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
assert(pA.use_count() == 2);
assert(pA2.use_count() == 2);
#endif // _LIBCPP_MOVE
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
assert(pA2.get() == p);
}
#ifdef _LIBCPP_MOVE
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
assert(pA.use_count() == 0);
assert(A::count == 0);
#else // _LIBCPP_MOVE
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
assert(pA.use_count() == 1);
assert(A::count == 1);
#endif // _LIBCPP_MOVE
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
assert(A::count == 0);
{