OpenCores
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 715

Go to most recent revision | 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>());
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.