PR tree-optimization/86401
[official-gcc.git] / gcc / testsuite / c-c++-common / pr69543-3.c
blobfcf750cc05d37d87965dca5ed8ea8cb37d41a44c
1 /* { dg-options "-Wuninitialized" } */
3 /* Verify disabling a warning, where the _Pragma is in regular code,
4 but the affected code is within a macro. */
6 /* TODO: XFAIL: both C and C++ erroneously fail to suppress the warning
7 The warning is reported at the macro definition location, rather than
8 the macro expansion location. */
10 #define WARNABLE_CODE *++yyvsp = yylval; /* { dg-bogus "used uninitialized" "" { xfail *-*-* } } */
12 void test (char yylval)
14 char *yyvsp; /* { dg-bogus "declared here" "" { xfail *-*-* } } */
15 _Pragma ("GCC diagnostic push")
16 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
17 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
18 WARNABLE_CODE
19 _Pragma ("GCC diagnostic pop")