summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wmissing-field-initializers-1.C
blob: 47308d9d200c39ad78977f79f59a2f33a063708f (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
// PR c++/61489
// { dg-options "-Wmissing-field-initializers" }

struct mystruct1 {
  int a, b;
};

struct aux2 {
  aux2();
};

struct mystruct2 {
  aux2 a, b;
};

struct aux3 {
  int x;
};

struct mystruct3 {
  aux3 a, b;
};

mystruct1 obj11 = {};
mystruct1 obj12 = {0};       // { dg-warning "missing initializer" }

mystruct2 obj21 = {};
mystruct2 obj22 = {aux2()};  // { dg-warning "missing initializer" }

mystruct3 obj31 = {};
mystruct3 obj32 = {0};       // { dg-warning "missing initializer" }