Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wuninitialized-17.C
blob80c37aca735fe7351b28e4a084ab91bd1c8b3441
1 // PR c++/19808
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wuninitialized -Winit-self" }
5 int
6 foo (int *p)
8   *p = 42;
9   return 5;
12 struct S {
13   int x;
14   int y;
15   int z;
16   S() : x(foo (&y)), z(y) { } // { dg-bogus "uninitialized" }
19 struct T {
20   int x;
21   int y;
22   int z;
23   T() : x(({ y = 30; 42; })), z(y) { } // { dg-bogus "uninitialized" }
26 struct A {
27   int x, y, z;
28   int f () { y = 1; return 2; }
29   A ():
30     x (f ()),
31     z (y) // { dg-bogus "uninitialized" }
32   { }