Make rvalue metaprogramming traits work in C++03.
The next step is to get move and forward working in C++03.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@364053 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/type_traits b/include/type_traits
index f0c7fde..c02a208 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -808,15 +808,11 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference<_Tp&> : public true_type {};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference : public false_type {};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference<_Tp&&> : public true_type {};
-#endif
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference : public false_type {};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&> : public true_type {};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&&> : public true_type {};
-#endif
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp>
@@ -1130,9 +1126,7 @@
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;};
-#endif
#if _LIBCPP_STD_VER > 11
template <class _Tp> using remove_reference_t = typename remove_reference<_Tp>::type;
@@ -1150,8 +1144,6 @@
template <class _Tp> using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type;
#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_rvalue_reference_impl { typedef _LIBCPP_NODEBUG_TYPE _Tp type; };
template <class _Tp > struct __add_rvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG_TYPE _Tp&& type; };
@@ -1162,10 +1154,6 @@
template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type;
#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Tp> _Tp&& __declval(int);
template <class _Tp> _Tp __declval(long);
@@ -1173,14 +1161,6 @@
decltype(_VSTD::__declval<_Tp>(0))
declval() _NOEXCEPT;
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template <class _Tp>
-typename add_lvalue_reference<_Tp>::type
-declval();
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
// __uncvref
template <class _Tp>
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp
index b40e68a..3abc949 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp
@@ -58,23 +58,19 @@
// LWG 2101 specifically talks about add_lvalue_reference and functions.
// The term of art is "a referenceable type", which a cv- or ref-qualified function is not.
test_function0<void()>();
-#if TEST_STD_VER >= 11
test_function1<void() const>();
test_function1<void() &>();
test_function1<void() &&>();
test_function1<void() const &>();
test_function1<void() const &&>();
-#endif
// But a cv- or ref-qualified member function *is* "a referenceable type"
test_function0<void (Foo::*)()>();
-#if TEST_STD_VER >= 11
test_function0<void (Foo::*)() const>();
test_function0<void (Foo::*)() &>();
test_function0<void (Foo::*)() &&>();
test_function0<void (Foo::*)() const &>();
test_function0<void (Foo::*)() const &&>();
-#endif
return 0;
}
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp
index 22628a3..d67db44 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp
@@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++98, c++03
-
// type_traits
// add_rvalue_reference
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp
index 50927fa..2b11e0b 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp
@@ -36,13 +36,11 @@
test_remove_reference<int*&, int*>();
test_remove_reference<const int*&, const int*>();
-#if TEST_STD_VER >= 11
test_remove_reference<int&&, int>();
test_remove_reference<const int&&, const int>();
test_remove_reference<int(&&)[3], int[3]>();
test_remove_reference<int*&&, int*>();
test_remove_reference<const int*&&, const int*>();
-#endif
return 0;
}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp
index ed32cd9..9235efb 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp
@@ -10,8 +10,6 @@
// is_lvalue_reference
-// UNSUPPORTED: c++98, c++03
-
#include <type_traits>
#include <cstddef> // for std::nullptr_t
#include "test_macros.h"
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp
index d17ed5f..b424c7e 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp
@@ -10,8 +10,6 @@
// is_rvalue_reference
-// UNSUPPORTED: c++98, c++03
-
#include <type_traits>
#include <cstddef> // for std::nullptr_t
#include "test_macros.h"
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp
index e40a2a0..b253779 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp
@@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++98, c++03
-
// type_traits
// rvalue_ref
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.comp/is_reference.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_reference.pass.cpp
index bb8a2d6..e6fd1e6 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.comp/is_reference.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.comp/is_reference.pass.cpp
@@ -75,10 +75,7 @@
int main(int, char**)
{
test_is_reference<int&>();
-#if TEST_STD_VER >= 11
test_is_reference<int&&>();
-#endif
-
test_is_not_reference<std::nullptr_t>();
test_is_not_reference<void>();
test_is_not_reference<int>();
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp
index f00307a..13b35d3 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.comp/rvalue_ref.pass.cpp
@@ -6,8 +6,6 @@
//
//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++98, c++03
-
// type_traits
// rvalue_ref
diff --git a/test/std/utilities/utility/declval/declval.pass.cpp b/test/std/utilities/utility/declval/declval.pass.cpp
index 6509fd4..f56a6fd 100644
--- a/test/std/utilities/utility/declval/declval.pass.cpp
+++ b/test/std/utilities/utility/declval/declval.pass.cpp
@@ -23,11 +23,7 @@
int main(int, char**)
{
-#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), "");
-#endif
return 0;
}