summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/constexpr-init3.C
blob: dd2735289cb669902b6570d78d11b5f58a9de90e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
// { dg-do compile { target c++2a } }

struct A
{
  int i;
  constexpr A() {} 
};

struct B
{
  A a;
};

// A::i not initialized.
constexpr B b[] = { {} }; // { dg-error "is not a constant expression" }