This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/81779] bool define from stdbool.h suppresses -Wdeclaration-after-statement
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Aug 2017 10:59:31 +0000
- Subject: [Bug c/81779] bool define from stdbool.h suppresses -Wdeclaration-after-statement
- Auto-submitted: auto-generated
- References: <bug-81779-4@http.gcc.gnu.org/bugzilla/>
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>.