aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/constexpr-init23.C
blob: 466236d446d8729d868972d004b08f09bca7a03d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/115900
// { dg-do compile { target c++20 } }

struct A {
    char m;
    constexpr A() { m = 0; }
};

struct C {
  constexpr C(){ };
};

struct B : C {
  A a;
  constexpr B() {}
};

struct D : B { };

static constexpr A a;
static constexpr B b;
static constexpr D d;