diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:58 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:58 +0000 |
commit | 53a420fba21cf1644972b34dcd811a43cdb8368d (patch) | |
tree | 66a19f6f8b65215772549a51d688492ab8addc0d /test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp | |
parent | b50f1549701eb950921e5d6f2e55ba1a1dadbb43 (diff) | |
download | src-53a420fba21cf1644972b34dcd811a43cdb8368d.tar.gz src-53a420fba21cf1644972b34dcd811a43cdb8368d.zip |
Vendor import of libc++ trunk r290819:vendor/libc++/libc++-trunk-r290819
Notes
Notes:
svn path=/vendor/libc++/dist/; revision=311123
svn path=/vendor/libc++/libc++-trunk-r290819/; revision=311124; tag=vendor/libc++/libc++-trunk-r290819
Diffstat (limited to 'test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp')
-rw-r--r-- | test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp index f041d9451a6d..ea0720404b48 100644 --- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp +++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <memory> // shared_ptr @@ -17,6 +19,8 @@ #include <type_traits> #include <cassert> +#include "test_macros.h" + struct B { static int count; @@ -66,24 +70,24 @@ int main() std::shared_ptr<B> pB(std::move(pA)); assert(B::count == 1); assert(A::count == 1); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 assert(pB.use_count() == 1); assert(pA.use_count() == 0); -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#else assert(pB.use_count() == 2); assert(pA.use_count() == 2); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif assert(p == pB.get()); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 assert(pA.use_count() == 0); assert(B::count == 0); assert(A::count == 0); -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#else assert(pA.use_count() == 1); assert(B::count == 1); assert(A::count == 1); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif } assert(B::count == 0); assert(A::count == 0); |