1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2 // expected-no-diagnostics
3 
4 // The result of the expression const_cast<T>(v) is of type T. If T is
5 // an lvalue reference to object type, the result is an lvalue; if T
6 // is an rvalue reference to object type, the result is an xvalue;.
7 
8 unsigned int f(int);
9 
10 template<typename T> T& lvalue();
11 template<typename T> T&& xvalue();
12 template<typename T> T prvalue();
13 
14 void test_classification(const int *ptr) {
15   int *ptr0 = const_cast<int *&&>(ptr);
16   int *ptr1 = const_cast<int *&&>(xvalue<const int*>());
17   int *ptr2 = const_cast<int *&&>(prvalue<const int*>());
18 }
19