summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/memory
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-07-28 07:31:50 +0000
committerEric Fiselier <eric@efcs.ca>2015-07-28 07:31:50 +0000
commitabd52cad847e56575e6692e7f43a76e510e67b7e (patch)
treefecc8aa7a2c19766b1110f814b7254f772dcd664 /libcxx/test/std/utilities/memory
parent47a7b95b1da244db1ae9b6217c17917ccca4701a (diff)
downloadbcm5719-llvm-abd52cad847e56575e6692e7f43a76e510e67b7e.tar.gz
bcm5719-llvm-abd52cad847e56575e6692e7f43a76e510e67b7e.zip
Fix a handful of tests that fail in C++03
llvm-svn: 243392
Diffstat (limited to 'libcxx/test/std/utilities/memory')
-rw-r--r--libcxx/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp
index d0a870e6069..40c44d94906 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp
@@ -15,6 +15,7 @@
#include <memory>
#include <cassert>
+#include "test_macros.h"
#include "count_new.hpp"
int A_constructed = 0;
@@ -34,30 +35,22 @@ struct A
int move_only_constructed = 0;
+#if TEST_STD_VER >= 11
class move_only
{
int data;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(const move_only&);
- move_only& operator=(const move_only&);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- move_only(move_only&);
- move_only& operator=(move_only&);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-public:
+ move_only(const move_only&) = delete;
+ move_only& operator=(const move_only&)= delete;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+public:
move_only(move_only&&) {++move_only_constructed;}
move_only& operator=(move_only&&) {return *this;}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- operator std::__rv<move_only> () {return std::__rv<move_only>(*this);}
- move_only(std::__rv<move_only>) {++move_only_constructed;}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
move_only() {++move_only_constructed;}
~move_only() {--move_only_constructed;}
};
+#endif // TEST_STD_VER >= 11
int main()
{
@@ -108,6 +101,7 @@ int main()
assert(globalMemCounter.checkOutstandingNewEq(0));
assert(A_constructed == 0);
}
+#if TEST_STD_VER >= 11
{
std::allocator<move_only> a;
assert(globalMemCounter.checkOutstandingNewEq(0));
@@ -139,4 +133,5 @@ int main()
assert(globalMemCounter.checkOutstandingNewEq(0));
assert(move_only_constructed == 0);
}
+#endif
}
OpenPOWER on IntegriCloud