OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [tm/] [noexcept-2.C] - Rev 749

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

// { dg-do compile }
// { dg-options "-fgnu-tm -std=c++0x" }

// All of these must fail, because they are not constant expressions.
template<typename T> int foo(int x, T t)
{
  __transaction_atomic noexcept(t) { x++; }      /* { dg-error "not a constant" } */
  return __transaction_atomic noexcept(t) (x+1); /* { dg-error "not a constant" } */
}

int bar(int x)
{
  __transaction_atomic noexcept(x == 23) { x++; }      /* { dg-error "not a constant" } */
  return __transaction_atomic noexcept(x == 42) (x+1); /* { dg-error "not a constant" } */
}

int f(int x)
{
  return foo<bool>(x, true);
}

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.