blob: 81f4df8e8b2b992ed3196f3cbb5c0eae43cb275f [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnant5b08a8a2010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnant3e519522010-05-11 19:42:16 +00004//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant3e519522010-05-11 19:42:16 +00007//
8//===----------------------------------------------------------------------===//
9
10// <utility>
11
12// template <class T> typename add_rvalue_reference<T>::type declval() noexcept;
13
14#include <utility>
15#include <type_traits>
16
17class A
18{
19 A(const A&);
20 A& operator=(const A&);
21};
22
23int main()
24{
Howard Hinnant7609c9b2010-09-04 23:28:19 +000025#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnant3e519522010-05-11 19:42:16 +000026 static_assert((std::is_same<decltype(std::declval<A>()), A&&>::value), "");
27#else
28 static_assert((std::is_same<decltype(std::declval<A>()), A>::value), "");
29#endif
30}