annotate gcc/testsuite/c-c++-common/pr69543-3.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-options "-Wuninitialized" } */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 /* Verify disabling a warning, where the _Pragma is in regular code,
kono
parents:
diff changeset
4 but the affected code is within a macro. */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 /* TODO: XFAIL: both C and C++ erroneously fail to suppress the warning
kono
parents:
diff changeset
7 The warning is reported at the macro definition location, rather than
kono
parents:
diff changeset
8 the macro expansion location. */
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 #define WARNABLE_CODE *++yyvsp = yylval; /* { dg-bogus "used uninitialized" "" { xfail *-*-* } } */
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 void test (char yylval)
kono
parents:
diff changeset
13 {
kono
parents:
diff changeset
14 char *yyvsp; /* { dg-bogus "declared here" "" { xfail *-*-* } } */
kono
parents:
diff changeset
15 _Pragma ("GCC diagnostic push")
kono
parents:
diff changeset
16 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
kono
parents:
diff changeset
17 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
kono
parents:
diff changeset
18 WARNABLE_CODE
kono
parents:
diff changeset
19 _Pragma ("GCC diagnostic pop")
kono
parents:
diff changeset
20 }