diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2014-10-23 03:57:52 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2014-10-23 03:57:52 +0000 |
commit | 3d541d12ed64777e8a395c79e19ebdd467ca022e (patch) | |
tree | 543872b5800671a440fa38ede7946630cdf5428e /libcxx/test/utilities/memory/util.smartptr | |
parent | 78d325c1435c5e75cc0d43de01814e800ff13706 (diff) | |
download | bcm5719-llvm-3d541d12ed64777e8a395c79e19ebdd467ca022e.tar.gz bcm5719-llvm-3d541d12ed64777e8a395c79e19ebdd467ca022e.zip |
Fix a couple of failing tests for C++03 by checking for rvalue reference support first.
llvm-svn: 220465
Diffstat (limited to 'libcxx/test/utilities/memory/util.smartptr')
2 files changed, 4 insertions, 3 deletions
diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp index 1fdf883a5c8..75bf3df90aa 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr.pass.cpp @@ -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 } diff --git a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp index 70ad11b663d..51a8fa5ae81 100644 --- a/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp +++ b/libcxx/test/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.const/weak_ptr_Y.pass.cpp @@ -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), ""); |