1 /* { dg-options "-Wuninitialized" } */
3 /* Verify disabling a warning, where both the _Pragma and the
4 affected code are within (different) macros. */
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 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
11 _Pragma ("GCC diagnostic push") \
12 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
13 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
14 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
15 _Pragma ("GCC diagnostic pop")
17 #define WARNABLE_CODE *++yyvsp = yylval; /* { dg-bogus "used uninitialized" "" { xfail *-*-* } } */
19 void test (char yylval
)
21 char *yyvsp
; /* { dg-bogus "declared here" "" { xfail *-*-* } } */
22 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
24 YY_IGNORE_MAYBE_UNINITIALIZED_END