public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-11] openmp: Fix up cp/parser.c build with GCC 4.8 to 6
@ 2021-08-11  7:14 Tobias Burnus
  0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2021-08-11  7:14 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:adf2ca45182f767610cdd813f66b6cfa84ba0bf5

commit adf2ca45182f767610cdd813f66b6cfa84ba0bf5
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Aug 10 18:30:27 2021 +0200

    openmp: Fix up cp/parser.c build with GCC 4.8 to 6
    
    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
    as obvious.
    
    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.
    
    (cherry picked from commit d796cc7a3e719cc36f1851ca322e2877b974691b)

Diff:
---
 gcc/cp/ChangeLog.omp | 9 +++++++++
 gcc/cp/parser.c      | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/gcc/cp/ChangeLog.omp b/gcc/cp/ChangeLog.omp
index b457f5d901e..dbc0245c4d3 100644
--- a/gcc/cp/ChangeLog.omp
+++ b/gcc/cp/ChangeLog.omp
@@ -1,3 +1,12 @@
+2021-08-10  Tobias Burnus  <tobias@codesourcery.com>
+
+	Backported from master:
+	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.
+
 2021-08-10  Tobias Burnus  <tobias@codesourcery.com>
 
 	Backported from master:
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 5a7a4c98390..824c8288f40 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -26500,8 +26500,9 @@ cp_parser_member_declaration (cp_parser* 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);
@@ -26511,7 +26512,6 @@ cp_parser_member_declaration (cp_parser* 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,


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-11  7:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11  7:14 [gcc/devel/omp/gcc-11] openmp: Fix up cp/parser.c build with GCC 4.8 to 6 Tobias Burnus

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).