Fix a handful of tests that fail in C++03

llvm-svn: 243392
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 d0a870e..40c44d9 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 @@
 
 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
+
+    move_only(const move_only&) = delete;
+    move_only& operator=(const move_only&)= delete;
 
 public:
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     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 @@
     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 @@
     assert(globalMemCounter.checkOutstandingNewEq(0));
     assert(move_only_constructed == 0);
     }
+#endif
 }
diff --git a/libcxx/test/std/utilities/utility/declval/declval.pass.cpp b/libcxx/test/std/utilities/utility/declval/declval.pass.cpp
index 81f4df8..aabd0e6 100644
--- a/libcxx/test/std/utilities/utility/declval/declval.pass.cpp
+++ b/libcxx/test/std/utilities/utility/declval/declval.pass.cpp
@@ -14,6 +14,8 @@
 #include <utility>
 #include <type_traits>
 
+#include "test_macros.h"
+
 class A
 {
     A(const A&);
@@ -22,9 +24,9 @@
 
 int main()
 {
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     static_assert((std::is_same<decltype(std::declval<A>()), A&&>::value), "");
 #else
-    static_assert((std::is_same<decltype(std::declval<A>()), A>::value), "");
+    static_assert((std::is_same<decltype(std::declval<A>()), A&>::value), "");
 #endif
 }
diff --git a/libcxx/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp b/libcxx/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp
index c8375e9..bc60d3d 100644
--- a/libcxx/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp
+++ b/libcxx/test/std/utilities/utility/forward/move_if_noexcept.pass.cpp
@@ -56,13 +56,14 @@
     static_assert((std::is_same<decltype(std::move_if_noexcept(ca)), const A&&>::value), "");
     static_assert((std::is_same<decltype(std::move_if_noexcept(l)), const legacy&>::value), "");
 #else  // C++ < 11
-    // libc++ defines decltype to be __typeof__ in C++03. __typeof__ does not
-    // deduce the reference qualifiers.
-    static_assert((std::is_same<decltype(std::move_if_noexcept(i)), const int>::value), "");
-    static_assert((std::is_same<decltype(std::move_if_noexcept(ci)), const int>::value), "");
-    static_assert((std::is_same<decltype(std::move_if_noexcept(a)), const A>::value), "");
-    static_assert((std::is_same<decltype(std::move_if_noexcept(ca)), const A>::value), "");
-    static_assert((std::is_same<decltype(std::move_if_noexcept(l)), const legacy>::value), "");
+    // In C++03 libc++ #define's decltype to be __decltype on clang and
+    // __typeof__ for other compilers. __typeof__ does not deduce the reference
+    // qualifiers and will cause this test to fail.
+    static_assert((std::is_same<decltype(std::move_if_noexcept(i)), const int&>::value), "");
+    static_assert((std::is_same<decltype(std::move_if_noexcept(ci)), const int&>::value), "");
+    static_assert((std::is_same<decltype(std::move_if_noexcept(a)), const A&>::value), "");
+    static_assert((std::is_same<decltype(std::move_if_noexcept(ca)), const A&>::value), "");
+    static_assert((std::is_same<decltype(std::move_if_noexcept(l)), const legacy&>::value), "");
 #endif
 
 #if TEST_STD_VER > 11