aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C
blob: a8af2e66f2a07ded4bb8c5a9e422cfe34fe4c466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// A constructor that might or might not be constexpr still makes
// its class literal.
// { dg-do compile { target c++11 } }

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

struct A
{
  B<A> b;
};

constexpr A a {};

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

struct D
{
  C<D> c;
};

constexpr D d {};		// { dg-error "non-constexpr function" }