This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/63326] whether a #pragma is a statement depends on the type of pragma
- From: "gang.chen.5i5j at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 22 Nov 2015 22:18:37 +0000
- Subject: [Bug c/63326] whether a #pragma is a statement depends on the type of pragma
- Auto-submitted: auto-generated
- References: <bug-63326-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63326
--- Comment #17 from Chen Gang <gang.chen.5i5j at gmail dot com> ---
I guess the diff below should be OK, I shall give a make check test.
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 7b10764..2666657 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -5170,7 +5170,9 @@ c_parser_statement_after_labels (c_parser *parser,
vec<tree> *chain)
c_parser_consume_token (parser);
break;
case CPP_PRAGMA:
- c_parser_pragma (parser, pragma_stmt);
+ c_parser_error (parser,
+ "don't allow if, while, do, swith, or label"
+ );
break;
default:
expr_stmt: