]> gcc.gnu.org Git - gcc.git/commit
re PR c++/60228 (ICE using lambda in #pragma omp declare reduction)
authorJakub Jelinek <jakub@gcc.gnu.org>
Fri, 29 Nov 2019 09:10:44 +0000 (10:10 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 29 Nov 2019 09:10:44 +0000 (10:10 +0100)
commit52702016ad1b45888ddd37e95e3eb093181fd4d3
tree568163140fea7442c6e8bd868b88174618d79123
parentb3f44388f3bb9b42553ea516984db4c4d4baa5bc
re PR c++/60228 (ICE using lambda in #pragma omp declare reduction)

PR c++/60228
* parser.c (cp_parser_omp_declare_reduction_exprs): If
processing_template_decl, wrap the combiner or initializer
into EXPR_STMT.
* decl.c (start_preparsed_function): Don't start a lambda scope
for DECL_OMP_DECLARE_REDUCTION_P functions.
(finish_function): Don't finish a lambda scope for
DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function
them nor cp_genericize them.
* mangle.c (decl_mangling_context): Look through
DECL_OMP_DECLARE_REDUCTION_P functions.
* semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P
functions, use tentative linkage, don't keep their bodies with
-fkeep-inline-functions and return false at the end.

* g++.dg/gomp/openmp-simd-2.C: Don't expect bodies for
DECL_OMP_DECLARE_REDUCTION_P functions.

* testsuite/libgomp.c++/udr-20.C: New test.
* testsuite/libgomp.c++/udr-21.C: New test.

From-SVN: r278832
libgomp/testsuite/libgomp.c++/udr-20.C
libgomp/testsuite/libgomp.c++/udr-21.C
This page took 0.055203 seconds and 5 git commands to generate.