Debian Codegraph @

gcc/testsuite/g++.dg/warn/Wuninitialized-21.C

raw
1 // PR c++/19808
2 // { dg-do compile }
3 // { dg-options "-Wuninitialized" }
4
5 struct A {
6 int a;
7 int b;
8 A(int) {}
9 };
10
11 struct S {
12 A a;
13 A a2;
14 S() :
15 /* We don't warn here, because we consider partial initialization
16 as initializing the whole object. */
17 a((a2.a = 42)),
18 a2(a2.a)
19 { }
20 };