diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/cp-gimplify.c | 17 | ||||
-rw-r--r-- | gcc/cp/parser.c | 2 |
3 files changed, 21 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bb5f77f..b5d429b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2020-03-19 Jakub Jelinek <jakub@redhat.com> + + PR c++/93931 + * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref + on outer_automatic_var_p decls. + * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for + capture proxy decls. + 2020-03-18 Nathan Sidwell <nathan@acm.org> PR c++/94147 - mangling of lambdas assigned to globals diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 23a25e5..87c7e39 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -2260,12 +2260,17 @@ cxx_omp_finish_clause (tree c, gimple_seq *) bool cxx_omp_disregard_value_expr (tree decl, bool shared) { - return !shared - && VAR_P (decl) - && DECL_HAS_VALUE_EXPR_P (decl) - && DECL_ARTIFICIAL (decl) - && DECL_LANG_SPECIFIC (decl) - && DECL_OMP_PRIVATIZED_MEMBER (decl); + if (shared) + return false; + if (VAR_P (decl) + && DECL_HAS_VALUE_EXPR_P (decl) + && DECL_ARTIFICIAL (decl) + && DECL_LANG_SPECIFIC (decl) + && DECL_OMP_PRIVATIZED_MEMBER (decl)) + return true; + if (VAR_P (decl) && DECL_CONTEXT (decl) && is_capture_proxy (decl)) + return true; + return false; } /* Fold expression X which is used as an rvalue if RVAL is true. */ diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 198ab97..cbd5510 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -34059,6 +34059,8 @@ cp_parser_omp_var_list_no_open (cp_parser *parser, enum omp_clause_code kind, token->location); } } + if (outer_automatic_var_p (decl)) + decl = process_outer_var_ref (decl, tf_warning_or_error); if (decl == error_mark_node) ; else if (kind != 0) |