re PR c++/84430 (ICE with #pragma omp simd in lambda)
authorJakub Jelinek <jakub@redhat.com>
Mon, 19 Feb 2018 19:12:14 +0000 (20:12 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 19 Feb 2018 19:12:14 +0000 (20:12 +0100)
PR c++/84430
* constexpr.c (potential_constant_expression_1): Handle OMP_SIMD.

* g++.dg/gomp/pr84430.C: New test.

From-SVN: r257820

gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gomp/pr84430.C [new file with mode: 0644]

index 7ebd5ab0384806acbb539763145e1d565f058cb6..58fc0935903ae433b23e34e9c5079e3ea177786d 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84430
+       * constexpr.c (potential_constant_expression_1): Handle OMP_SIMD.
+
 2018-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/84348
index bda9b2d211e3a3ec9133737e45f0c4003829beb9..f095b038d323ca326cb38e3b839e65c5b93e48ca 100644 (file)
@@ -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:
index 5975b23bb880841c746894f71e3899aed4ec6a61..fcb1d33b8dafc8284a9a164469974a76155d759a 100644 (file)
@@ -1,5 +1,8 @@
 2018-02-19  Jakub Jelinek  <jakub@redhat.com>
 
+       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 (file)
index 0000000..cf9275a
--- /dev/null
@@ -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)
+      ;
+  };
+}