URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [rv-cast2.C] - Rev 693
Compare with Previous | Blame | View Log
// Test for const_cast to reference (5.2.11/4).
// { dg-options -std=c++0x }
template <class T> T&& xval();
template <class T> T& lval();
template <class T> T prval();
struct A { };
int main()
{
const_cast<int&>(lval<int>());
const_cast<int&>(xval<int>()); // { dg-error "" }
const_cast<int&>(prval<int>()); // { dg-error "" }
const_cast<int&&>(lval<int>());
const_cast<int&&>(xval<int>());
const_cast<int&&>(prval<int>()); // { dg-error "" }
const_cast<A&&>(lval<A>());
const_cast<A&&>(xval<A>());
const_cast<A&&>(prval<A>());
}