aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-11-22 10:13:24 +0100
committerJakub Jelinek <jakub@redhat.com>2021-11-22 10:13:24 +0100
commit4b1e14346a08554dc33f71fca980578a7a3e38a2 (patch)
tree70bc6bafdbc07070e7936b382bf70afc92faf41f /gcc
parentb5844cb0bc8c7d9be2ff1ecded249cad82b9b71c (diff)
downloadgcc-4b1e14346a08554dc33f71fca980578a7a3e38a2.zip
gcc-4b1e14346a08554dc33f71fca980578a7a3e38a2.tar.gz
gcc-4b1e14346a08554dc33f71fca980578a7a3e38a2.tar.bz2
openmp: Handle OMP_MASKED in potential_constant_expression_1 [PR103349]
WHen adding OMP_MASKED, I apparently forgot to handle it in potential_constant_expression_1, which means we can ICE on it. 2021-11-22 Jakub Jelinek <jakub@redhat.com> PR c++/103349 * constexpr.c (potential_constant_expression_1): Punt on OMP_MASKED. * g++.dg/gomp/masked-1.C: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/constexpr.c1
-rw-r--r--gcc/testsuite/g++.dg/gomp/masked-1.C14
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index c8f9d5f..d66a565 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -8686,6 +8686,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
case OMP_SINGLE:
case OMP_SECTION:
case OMP_MASTER:
+ case OMP_MASKED:
case OMP_TASKGROUP:
case OMP_TARGET_UPDATE:
case OMP_TARGET_ENTER_DATA:
diff --git a/gcc/testsuite/g++.dg/gomp/masked-1.C b/gcc/testsuite/g++.dg/gomp/masked-1.C
new file mode 100644
index 0000000..1ea4a13
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/masked-1.C
@@ -0,0 +1,14 @@
+// PR c++/103349
+// { dg-do compile { target c++11 } }
+
+int v;
+
+void
+foo (int x, int y)
+{
+ [=] ()
+ {
+#pragma omp masked
+ v = x + y;
+ } ();
+}