diff options
author | Marek Polacek <polacek@redhat.com> | 2024-02-13 16:21:32 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2024-02-13 17:41:21 -0500 |
commit | 6fec511f2d23cc70ab29d1ba79c2415ab51bcb60 (patch) | |
tree | bbb00a3753bf4108ea0805a774a7a8701b521058 /gcc/cp/parser.cc | |
parent | ab71fd7ac7a2307723117c796e7ae4d7e9711058 (diff) | |
download | gcc-6fec511f2d23cc70ab29d1ba79c2415ab51bcb60.zip gcc-6fec511f2d23cc70ab29d1ba79c2415ab51bcb60.tar.gz gcc-6fec511f2d23cc70ab29d1ba79c2415ab51bcb60.tar.bz2 |
c++: adjust the extra ; warning [PR113760]
A minimal fix to quash an extra ; warning. I have a more complete
patch for GCC 15.
DR 1693
PR c++/113760
gcc/cp/ChangeLog:
* parser.cc (cp_parser_member_declaration): Only pedwarn about an extra
semicolon in C++98.
gcc/testsuite/ChangeLog:
* g++.dg/semicolon-fixits.C: Run in C++98 only.
* g++.dg/warn/pedantic2.C: Adjust dg-warning.
* g++.old-deja/g++.jason/parse11.C: Adjust dg-error.
* g++.dg/DRs/dr1693-1.C: New test.
* g++.dg/DRs/dr1693-2.C: New test.
Diffstat (limited to 'gcc/cp/parser.cc')
-rw-r--r-- | gcc/cp/parser.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 68ab74d..9d09144 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -27999,7 +27999,7 @@ cp_parser_member_declaration (cp_parser* parser) if (!decl_specifiers.any_specifiers_p) { cp_token *token = cp_lexer_peek_token (parser->lexer); - if (!in_system_header_at (token->location)) + if (cxx_dialect < cxx11 && !in_system_header_at (token->location)) { gcc_rich_location richloc (token->location); richloc.add_fixit_remove (); |