PR c++/90950
* semantics.c (finish_omp_clauses): Don't reject references to
incomplete types if processing_template_decl.
* g++.dg/gomp/lastprivate-1.C: New test.
From-SVN: r272543
+2019-06-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/90950
+ * semantics.c (finish_omp_clauses): Don't reject references to
+ incomplete types if processing_template_decl.
+
2019-06-19 Marek Polacek <polacek@redhat.com>
PR c++/60364 - noreturn after first decl not diagnosed.
t = require_complete_type (t);
if (t == error_mark_node)
remove = true;
- else if (TYPE_REF_P (TREE_TYPE (t))
+ else if (!processing_template_decl
+ && TYPE_REF_P (TREE_TYPE (t))
&& !complete_type_or_else (TREE_TYPE (TREE_TYPE (t)), t))
remove = true;
}
2019-06-21 Jakub Jelinek <jakub@redhat.com>
+ PR c++/90950
+ * g++.dg/gomp/lastprivate-1.C: New test.
+
* gcc.dg/vect/vect-simd-11.c: New test.
* gcc.target/i386/sse2-vect-simd-11.c: New test.
* gcc.target/i386/avx2-vect-simd-11.c: New test.
--- /dev/null
+// PR c++/90950
+// { dg-do compile }
+
+template <typename T>
+T
+foo (void)
+{
+ T y = 0;
+ T &x = y;
+ #pragma omp parallel for lastprivate (x)
+ for (int i = 0; i < 8; ++i)
+ x = i;
+ return x;
+}
+
+int a = foo<int> ();