aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-01-31 00:28:53 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-01-31 00:28:53 +0100
commit8b44f8ec4b20bf22350e484bb49303a36085b0d5 (patch)
treea61191a9badffefd029c7e7e1138b82d4c93e8e1
parent9c5365902aaee9033ed781bfc5e8147060e5b130 (diff)
downloadgcc-8b44f8ec4b20bf22350e484bb49303a36085b0d5.zip
gcc-8b44f8ec4b20bf22350e484bb49303a36085b0d5.tar.gz
gcc-8b44f8ec4b20bf22350e484bb49303a36085b0d5.tar.bz2
re PR c++/88988 (ICE: Segmentation fault (in lookup_name_real_1))
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
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/lambda.c3
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c++/pr88988.C28
4 files changed, 42 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4b90951..29d8742 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index bc64a41..4b7a358 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -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)));
}
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index e774e7f..4d1eca4 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -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
index 0000000..9dea35d
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr88988.C
@@ -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 ();
+}