* [committed] openmp: Fix up cp/parser.c build with GCC 4.8 to 6
@ 2021-08-10 16:08 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-08-10 16:08 UTC (permalink / raw)
To: gcc-patches; +Cc: clyon
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 <jakub@redhat.com>
* 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-10 16:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 16:08 [committed] openmp: Fix up cp/parser.c build with GCC 4.8 to 6 Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).