* [committed] Handle OMP_SIMD in potential_constant_expression_1 (PR c++/84430)
@ 2018-02-19 19:14 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2018-02-19 19:14 UTC (permalink / raw)
To: gcc-patches
Hi!
At least for now, unless OpenMP 5.0 will say something different,
#pragma omp simd is not usable in constexpr, but was forgotten in this spot.
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
committed to trunk.
2018-02-19 Jakub Jelinek <jakub@redhat.com>
PR c++/84430
* constexpr.c (potential_constant_expression_1): Handle OMP_SIMD.
* g++.dg/gomp/pr84430.C: New test.
--- gcc/cp/constexpr.c.jj 2018-02-16 23:38:05.138373372 +0100
+++ gcc/cp/constexpr.c 2018-02-19 15:28:41.907846544 +0100
@@ -5604,6 +5604,7 @@ potential_constant_expression_1 (tree t,
case OMP_PARALLEL:
case OMP_TASK:
case OMP_FOR:
+ case OMP_SIMD:
case OMP_DISTRIBUTE:
case OMP_TASKLOOP:
case OMP_TEAMS:
--- gcc/testsuite/g++.dg/gomp/pr84430.C.jj 2018-02-19 15:34:52.397001027 +0100
+++ gcc/testsuite/g++.dg/gomp/pr84430.C 2018-02-19 15:36:25.037039654 +0100
@@ -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)
+ ;
+ };
+}
Jakub
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-02-19 19:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 19:14 [committed] Handle OMP_SIMD in potential_constant_expression_1 (PR c++/84430) 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).