aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C
blob: 39be3ed571f10273ae16271979a765f9b38eee43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-do compile { target c++11 } }

template <class T> struct A
{
  constexpr T f ();
};

int g();

// We should complain about this.
template<> constexpr int A<int>::f()
{ return g(); }			// { dg-error "non-constexpr" }

// But not about this.
struct B
{
  int i;
  constexpr B(int i = g()):i(i) { }
};
struct C: B { };
C c;