aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog5
-rw-r--r--gcc/c/c-parser.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 143aff9..5587e2f 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-25 David Malcolm <dmalcolm@redhat.com>
+
+ * c-parser.c (c_parser_struct_or_union_specifier): Add fix-it
+ hint for removing extra semicolon.
+
2017-04-21 Jakub Jelinek <jakub@redhat.com>
PR c/80468
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 988369e..9398652 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -2948,8 +2948,13 @@ c_parser_struct_or_union_specifier (c_parser *parser)
/* Parse any stray semicolon. */
if (c_parser_next_token_is (parser, CPP_SEMICOLON))
{
- pedwarn (c_parser_peek_token (parser)->location, OPT_Wpedantic,
- "extra semicolon in struct or union specified");
+ location_t semicolon_loc
+ = c_parser_peek_token (parser)->location;
+ gcc_rich_location richloc (semicolon_loc);
+ richloc.add_fixit_remove ();
+ pedwarn_at_rich_loc
+ (&richloc, OPT_Wpedantic,
+ "extra semicolon in struct or union specified");
c_parser_consume_token (parser);
continue;
}