blob: aabd0e6f6c74a019e8881141c97f557441ebad7a [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
Eric Fiselierabd52ca2015-07-28 07:31:50 +000017#include "test_macros.h"
18
Howard Hinnant3e519522010-05-11 19:42:16 +000019class A
20{
21 A(const A&);
22 A& operator=(const A&);
23};
24
25int main()
26{
Eric Fiselierabd52ca2015-07-28 07:31:50 +000027#if TEST_STD_VER >= 11
Howard Hinnant3e519522010-05-11 19:42:16 +000028 static_assert((std::is_same<decltype(std::declval<A>()), A&&>::value), "");
29#else
Eric Fiselierabd52ca2015-07-28 07:31:50 +000030 static_assert((std::is_same<decltype(std::declval<A>()), A&>::value), "");
Howard Hinnant3e519522010-05-11 19:42:16 +000031#endif
32}