p1-0x.cpp revision 762bb9d0ad20320b9f97a841dce57ba5e8e48b07
1// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s 2 3// If T is an lvalue reference type or an rvalue reference to function 4// type, the result is an lvalue; if T is an rvalue reference to 5// object type, the result is an xvalue; 6 7unsigned int f(int); 8 9template<typename T> T&& xvalue(); 10void test_classification(char *ptr) { 11 int (&fr0)(int) = reinterpret_cast<int (&&)(int)>(f); 12 int &&ir0 = reinterpret_cast<int &&>(*ptr); 13 int &&ir1 = reinterpret_cast<int &&>(0); 14 int &&ir2 = reinterpret_cast<int &&>('a'); 15 int &&ir3 = reinterpret_cast<int &&>(xvalue<char>()); 16} 17