[cfe-commits] [libcxx] r131483 - /libcxx/trunk/test/utilities/utility/forward/move_if_noexcept.pass.cpp
Howard Hinnant
hhinnant at apple.com
Tue May 17 13:10:42 PDT 2011
Author: hhinnant
Date: Tue May 17 15:10:42 2011
New Revision: 131483
URL: http://llvm.org/viewvc/llvm-project?rev=131483&view=rev
Log:
Fix and beef up test bug for move_if_noexcept
Modified:
libcxx/trunk/test/utilities/utility/forward/move_if_noexcept.pass.cpp
Modified: libcxx/trunk/test/utilities/utility/forward/move_if_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/utility/forward/move_if_noexcept.pass.cpp?rev=131483&r1=131482&r2=131483&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/utility/forward/move_if_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/utilities/utility/forward/move_if_noexcept.pass.cpp Tue May 17 15:10:42 2011
@@ -12,7 +12,7 @@
// template <class T>
// typename conditional
// <
-// !has_nothrow_move_constructor<T>::value && has_copy_constructor<T>::value,
+// !is_nothrow_move_constructible<T>::value && is_copy_constructible<T>::value,
// const T&,
// T&&
// >::type
@@ -32,24 +32,32 @@
#endif
};
+struct legacy
+{
+ legacy() {}
+ legacy(const legacy&);
+};
+
int main()
{
int i = 0;
const int ci = 0;
+ legacy l;
A a;
const A ca;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
static_assert((std::is_same<decltype(std::move_if_noexcept(i)), 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(a)), A&&>::value), "");
+ static_assert((std::is_same<decltype(std::move_if_noexcept(ca)), const A&&>::value), "");
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
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), "");
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ static_assert((std::is_same<decltype(std::move_if_noexcept(l)), const legacy&>::value), "");
}
More information about the cfe-commits
mailing list