]>
Commit | Line | Data |
---|---|---|
5e74e93c MS |
1 | /* PR middle-end/50476 - Warn of pointer set to object whose lifetime is limited |
2 | { dg-do compile } | |
3 | { dg-options "-O1 -Wall" } */ | |
4 | ||
5 | int *x = 0; | |
6 | ||
7 | void f (void) | |
8 | { | |
9 | int y = 1; | |
10 | x = &y; | |
11 | } | |
12 | ||
13 | int g (void) | |
14 | { | |
15 | f (); | |
16 | ||
17 | return *x; // { dg-warning "\\\[-Wuninitialized" } | |
18 | } |