https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81779

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-08-10
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.  This patch fixes it

--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -4828,6 +4828,7 @@ c_parser_compound_statement_nostart (c_parser *parser)
   while (c_parser_next_token_is_not (parser, CPP_CLOSE_BRACE))
     {
       location_t loc = c_parser_peek_token (parser)->location;
+      loc = expansion_point_location_if_in_system_header (loc);
       if (c_parser_next_token_is_keyword (parser, RID_CASE)
      || c_parser_next_token_is_keyword (parser, RID_DEFAULT)
      || (c_parser_next_token_is (parser, CPP_NAME)

but we'll need more general way to approach this, something like I outlined in
<https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00207.html>.

Reply via email to