summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor15.C
blob: 5ad278a6aa4b73620314b6b561da36117824f03f (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
// PR c++/57694
// { dg-do compile { target c++11 } }

class A
{
private:
  int a;
  const int* const aptr;

public:
  constexpr A(int _a) : a(_a), aptr(&a) { }
};

class Data { } d1;

class B
{
private:
  Data* dptr1;

public:
  constexpr B(Data* _p) : dptr1(_p) {}
};

class Use
{
  static constexpr A a{2};
  static constexpr B b{&d1};
};