diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-04-25 14:10:52 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-04-25 14:10:52 +0000 |
commit | 83e4d5c3551142efae3f19f69c8a2eae51188b48 (patch) | |
tree | 95dffe7a23f7b79c3d296372f0180e4047adeda3 /gcc/cp/parser.c | |
parent | 112e1c2cd45796e62d4318dbebcae6491979d638 (diff) | |
download | gcc-83e4d5c3551142efae3f19f69c8a2eae51188b48.tar.gz |
C++: fix-it hint for removing stray semicolons
gcc/cp/ChangeLog:
* parser.c (cp_parser_member_declaration): Add fix-it hint
for removing stray semicolons.
gcc/testsuite/ChangeLog:
* g++.dg/semicolon-fixits.C: New test case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247244 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 31eb3d2e155..c9780f801db 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -23127,7 +23127,11 @@ cp_parser_member_declaration (cp_parser* parser) { cp_token *token = cp_lexer_peek_token (parser->lexer); if (!in_system_header_at (token->location)) - pedwarn (token->location, OPT_Wpedantic, "extra %<;%>"); + { + gcc_rich_location richloc (token->location); + richloc.add_fixit_remove (); + pedwarn_at_rich_loc (&richloc, OPT_Wpedantic, "extra %<;%>"); + } } else { |