From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp2.wavenetuk.net (unknown [195.26.37.10]) by sourceware.org (Postfix) with ESMTP id 44B983983C5E for ; Tue, 17 Nov 2020 16:58:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 44B983983C5E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=iain@sandoe.co.uk Received: from [192.168.1.212] (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp2.wavenetuk.net (Postfix) with ESMTPA id F1753600139 for ; Tue, 17 Nov 2020 16:58:42 +0000 (GMT) From: Iain Sandoe Content-Type: text/plain; charset=us-ascii; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [pushed] C++ : Remove an overzealous checking assert [PR97871] Message-Id: Date: Tue, 17 Nov 2020 16:58:25 +0000 To: GCC Patches X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-15.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KHOP_HELO_FCRDNS, MAY_BE_FORGED, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2020 16:58:45 -0000 Hi, This amends my commit from r11-4927 to remove an assert. tested on x86_64-darwin, pushed to master Iain ------- It seems we accept __attribute__(()) without any diagnostic at present, so my added checking assert fires for something like: __attribute__ (()) int a; Fixed by removing the assert; in the case that the user enters something like: __attribute__ (()) extern "C" int foo; The diagnostic about attributes before linkage specs will fire and show the empty attributes. gcc/cp/ChangeLog: PR c++/97871 * parser.c (cp_parser_declaration): Remove checking assert. --- gcc/cp/parser.c | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 42f705266bb..b7ef259b048 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -13536,7 +13536,6 @@ cp_parser_declaration (cp_parser* parser, tree prefix_attrs) { cp_lexer_save_tokens (parser->lexer); attributes = cp_parser_attributes_opt (parser); - gcc_checking_assert (attributes); cp_token *t1 = cp_lexer_peek_token (parser->lexer); cp_token *t2 = (t1->type == CPP_EOF ? t1 : cp_lexer_peek_nth_token (parser->lexer, 2)); -- 2.24.1