@@ -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)));
}
@@ -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 ();
+}