1 // Test for const_cast to reference (5.2.11/4).
2 // { dg-do compile { target c++11 } }
4 template <class T> T&& xval();
5 template <class T> T& lval();
6 template <class T> T prval();
12 const_cast<int&>(lval<int>());
13 const_cast<int&>(xval<int>()); // { dg-error "" }
14 const_cast<int&>(prval<int>()); // { dg-error "" }
15 const_cast<int&&>(lval<int>());
16 const_cast<int&&>(xval<int>());
17 const_cast<int&&>(prval<int>()); // { dg-error "" }
18 const_cast<A&&>(lval<A>());
19 const_cast<A&&>(xval<A>());
20 const_cast<A&&>(prval<A>());