re PR c++/88988 (ICE: Segmentation fault (in lookup_name_real_1))
authorJakub Jelinek <jakub@redhat.com>
Wed, 30 Jan 2019 23:28:53 +0000 (00:28 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 30 Jan 2019 23:28:53 +0000 (00:28 +0100)
PR c++/88988
* lambda.c (is_capture_proxy): Don't return true for
DECL_OMP_PRIVATIZED_MEMBER artificial vars.

* testsuite/libgomp.c++/pr88988.C: New test.

From-SVN: r268407

gcc/cp/ChangeLog
gcc/cp/lambda.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.c++/pr88988.C [new file with mode: 0644]

index 4b90951885897ed79457794d09df3674dd3343b8..29d8742236925de9c902339d08f3735c7b7f2725 100644 (file)
@@ -1,3 +1,9 @@
+2019-01-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/88988
+       * lambda.c (is_capture_proxy): Don't return true for
+       DECL_OMP_PRIVATIZED_MEMBER artificial vars.
+
 2019-01-30  Marek Polacek  <polacek@redhat.com>
 
        PR c++/89119 - ICE with value-initialization in template.
index bc64a4173f931786ce98d687e127ce822421b955..4b7a358a0add3ba36528f9527ea3092be497d389 100644 (file)
@@ -263,6 +263,9 @@ is_capture_proxy (tree decl)
          && !DECL_ANON_UNION_VAR_P (decl)
          && !DECL_DECOMPOSITION_P (decl)
          && !DECL_FNAME_P (decl)
+         && !(DECL_ARTIFICIAL (decl)
+              && DECL_LANG_SPECIFIC (decl)
+              && DECL_OMP_PRIVATIZED_MEMBER (decl))
          && LAMBDA_FUNCTION_P (DECL_CONTEXT (decl)));
 }
 
index e774e7fc1aeea6cdbb332e37448da362c92e97c9..4d1eca4d75db4dca701329b8f06d22dbfbb6b643 100644 (file)
@@ -1,3 +1,8 @@
+2019-01-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/88988
+       * testsuite/libgomp.c++/pr88988.C: New test.
+
 2019-01-28  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/89002
diff --git a/libgomp/testsuite/libgomp.c++/pr88988.C b/libgomp/testsuite/libgomp.c++/pr88988.C
new file mode 100644 (file)
index 0000000..9dea35d
--- /dev/null
@@ -0,0 +1,28 @@
+// PR c++/88988
+// { dg-do compile }
+// { dg-additional-options "-std=c++14" }
+
+extern "C" void abort ();
+
+template <typename T>
+struct A {
+  A () : a(), b()
+  {
+    [&] ()
+    {
+#pragma omp task firstprivate (a) shared (b)
+      b = ++a;
+#pragma omp taskwait
+    } ();
+  }
+
+  T a, b;
+};
+
+int
+main ()
+{
+  A<int> x;
+  if (x.a != 0 || x.b != 1)
+    abort ();
+}