From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 5EF32386FC31 for ; Tue, 10 Aug 2021 16:08:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5EF32386FC31 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-141-YA2Ax9A-Pge253NZX750fQ-1; Tue, 10 Aug 2021 12:08:10 -0400 X-MC-Unique: YA2Ax9A-Pge253NZX750fQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72EB9871803; Tue, 10 Aug 2021 16:08:09 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.193.120]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5B54620DE; Tue, 10 Aug 2021 16:08:08 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 17AG86RP1416556 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 10 Aug 2021 18:08:06 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 17AG85Ks1416555; Tue, 10 Aug 2021 18:08:05 +0200 Date: Tue, 10 Aug 2021 18:08:05 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Cc: clyon@gcc.gnu.org Subject: [committed] openmp: Fix up cp/parser.c build with GCC 4.8 to 6 Message-ID: <20210810160805.GN2380545@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 10 Aug 2021 16:08:13 -0000 Hi! Christophe Lyon reported that cp/parser.c no longer compiles with GCC 4.8.5 after my recent OpenMP changes. A goto out; there crosses odsd variable declaration, and odsd has a vec<...> member where vec has = default; default constructor and gcc before r7-2822-gd0b0fbd9fce2f30a82558bf2308b3a7b56c2f364 treated that as error. Fixed by moving the declaration earlier before the goto. Tested on x86_64-linux with GCC 4.8.5 system gcc, committed to trunk. 2021-08-10 Jakub Jelinek * parser.c (cp_parser_member_declaration): Move odsd declaration before cp_parser_using_declaration call to avoid errors with GCC 4.8 to 6. --- gcc/cp/parser.c.jj 2021-08-10 11:22:14.440607503 +0200 +++ gcc/cp/parser.c 2021-08-10 17:55:50.239528646 +0200 @@ -26651,8 +26651,9 @@ cp_parser_member_declaration (cp_parser* parser->colon_corrects_to_scope_p = false; + cp_omp_declare_simd_data odsd; if (cp_parser_using_declaration (parser, /*access_declaration=*/true)) - goto out; + goto out; /* Parse the decl-specifier-seq. */ decl_spec_token_start = cp_lexer_peek_token (parser->lexer); @@ -26662,7 +26663,6 @@ cp_parser_member_declaration (cp_parser* &decl_specifiers, &declares_class_or_enum); - cp_omp_declare_simd_data odsd; if (decl_specifiers.attributes && (flag_openmp || flag_openmp_simd)) cp_parser_handle_directive_omp_attributes (parser, &decl_specifiers.attributes, Jakub