This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/81779] bool define from stdbool.h suppresses -Wdeclaration-after-statement


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>.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]