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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [constexpr-diag1.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// Test that we explain why a template instantiation isn't constexpr
2
// { dg-options -std=c++0x }
3
 
4
template 
5
struct A
6
{
7
  T t;
8
  constexpr int f() { return 42; } // { dg-error "enclosing class" }
9
};
10
 
11
struct B { B(); operator int(); };
12
 
13
constexpr A ai = { 42 };
14
constexpr int i = ai.f();
15
 
16
constexpr int b = A().f();      // { dg-error "non-constexpr function" }
17
 
18
template 
19
constexpr int f (T t) { return 42; } // { dg-error "parameter" }
20
constexpr int x = f(B());            // { dg-error "constexpr" }

powered by: WebSVN 2.1.0

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