p1-0x.cpp revision 575d2a30f288ddab2f24a77dfcc71f6f7f808394
1// RUN: %clang_cc1 -std=c++0x -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