summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/pr43890.C
blob: 1b2807d0d98127efcc497300f1e03a4ca33cc14d (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
32
33
34
35
36
37
38
39
// PR c++/43890
// { dg-do compile }

class Outer
{
  public:
  Outer()
  : i(*this)
  {
  }

  class Inner
  {
    public:
    Inner(Outer& o)
    : o(o)
    , i(0)
    {
    }

    private:
    Outer& o;
    int const i;
  };

  private:
  Inner i;
};

class A {
  Outer o;
};

int main()
{
  A *a = new A;

  return 0;
}