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: