[libcxx] r220465 - Fix a couple of failing tests for C++03 by checking for rvalue reference support first.

Marshall Clow mclow.lists at gmail.com
Wed Oct 22 20:57:52 PDT 2014


Author: marshall
Date: Wed Oct 22 22:57:52 2014
New Revision: 220465

URL: http://llvm.org/viewvc/llvm-project?rev=220465&view=rev
Log:
Fix a couple of failing tests for C++03 by checking for rvalue reference support first.

Modified:
    libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp
    libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp

Modified: libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp?rev=220465&r1=220464&r2=220465&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp (original)
+++ libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp Wed Oct 22 22:57:52 2014
@@ -55,8 +55,10 @@ int C::count = 0;
 template <class T>
 std::weak_ptr<T> source (std::shared_ptr<T> p) { return std::weak_ptr<T>(p); }
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 template <class T>
 void sink (std::weak_ptr<T> &&) {}
+#endif
 
 int main()
 {
@@ -98,6 +100,7 @@ int main()
     assert(B::count == 0);
     assert(A::count == 0);
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::shared_ptr<A> ps(new A);
         std::weak_ptr<A> pA = source(ps);
@@ -107,4 +110,5 @@ int main()
     }
     assert(B::count == 0);
     assert(A::count == 0);
+#endif
 }

Modified: libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp?rev=220465&r1=220464&r2=220465&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp (original)
+++ libcxx/trunk/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp Wed Oct 22 22:57:52 2014
@@ -55,9 +55,6 @@ int C::count = 0;
 template <class T>
 std::weak_ptr<T> source (std::shared_ptr<T> p) { return std::weak_ptr<T>(p); }
 
-template <class T>
-void sink (std::weak_ptr<T> &&) {}
-
 int main()
 {
     static_assert(( std::is_convertible<std::weak_ptr<A>, std::weak_ptr<B> >::value), "");





More information about the cfe-commits mailing list