Home | History | Annotate | Download | only in declval
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      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 
     17 #include "test_macros.h"
     18 
     19 class A
     20 {
     21     A(const A&);
     22     A& operator=(const A&);
     23 };
     24 
     25 int main()
     26 {
     27 #if TEST_STD_VER >= 11
     28     static_assert((std::is_same<decltype(std::declval<A>()), A&&>::value), "");
     29 #else
     30     static_assert((std::is_same<decltype(std::declval<A>()), A&>::value), "");
     31 #endif
     32 }
     33