From: Jakub Jelinek Date: Mon, 19 Feb 2018 19:12:14 +0000 (+0100) Subject: re PR c++/84430 (ICE with #pragma omp simd in lambda) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=897064e27690d55c82ac1d6f23f78fa7651e0e1b;p=gcc.git re PR c++/84430 (ICE with #pragma omp simd in lambda) PR c++/84430 * constexpr.c (potential_constant_expression_1): Handle OMP_SIMD. * g++.dg/gomp/pr84430.C: New test. From-SVN: r257820 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7ebd5ab0384..58fc0935903 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-02-19 Jakub Jelinek + + PR c++/84430 + * constexpr.c (potential_constant_expression_1): Handle OMP_SIMD. + 2018-02-19 Paolo Carlini PR c++/84348 diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index bda9b2d211e..f095b038d32 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -5604,6 +5604,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, case OMP_PARALLEL: case OMP_TASK: case OMP_FOR: + case OMP_SIMD: case OMP_DISTRIBUTE: case OMP_TASKLOOP: case OMP_TEAMS: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5975b23bb88..fcb1d33b8da 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-02-19 Jakub Jelinek + PR c++/84430 + * g++.dg/gomp/pr84430.C: New test. + PR tree-optimization/84452 * gcc.dg/pr84452.c: New test. diff --git a/gcc/testsuite/g++.dg/gomp/pr84430.C b/gcc/testsuite/g++.dg/gomp/pr84430.C new file mode 100644 index 00000000000..cf9275acaa0 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr84430.C @@ -0,0 +1,12 @@ +// PR c++/84430 +// { dg-do compile { target c++11 } } + +void +foo () +{ + auto a = [] { + #pragma omp simd + for (int i = 0; i < 10; ++i) + ; + }; +}