From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 647013857C61; Mon, 6 Jul 2020 10:48:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 647013857C61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594032534; bh=XY/M3VN6+Z0Oe+e5OBR5CPooOZo275OdlebVFneQ26w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ndz6KKColv5Ob12jH+tU7ZUStGgtEMcpNaEzSgoekGQibOxvVGDfYJQnFvmdZqX5y yv1Wryi/LArzombQe1ZuCEk9g153ABVco5PO6MK7q/r1N5rwiSHFqCMMdsQ1myuYii CGb4duJtAKoAk67yUeFnNlZ56FQFGDNpqx3xERZ4= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96068] Extra semicolon outside of a function should be allowed after c++11? Date: Mon, 06 Jul 2020 10:48:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on bug_status everconfirmed keywords Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2020 10:48:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96068 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2020-07-06 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Keywords|diagnostic | --- Comment #1 from Jonathan Wakely --- --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -13502,10 +13502,11 @@ cp_parser_toplevel_declaration (cp_parser* parser) cp_parser_pragma (parser, pragma_external, NULL); else if (token->type =3D=3D CPP_SEMICOLON) { - /* A declaration consisting of a single semicolon is - invalid. Allow it unless we're being pedantic. */ cp_lexer_consume_token (parser->lexer); - pedwarn (input_location, OPT_Wpedantic, "extra %<;%>"); + /* A declaration consisting of a single semicolon is invalid + * before C++11. Allow it unless we're being pedantic. */ + if (cxx_dialect < cxx11) + pedwarn (input_location, OPT_Wpedantic, "extra %<;%>"); } else /* Parse the declaration itself. */=