2008-03-10 Jakub Jelinek <jakub@redhat.com>
+ PR c++/35328
+ * semantics.c (finish_omp_clauses): Look through NOP_EXPR even
+ if errorcount.
+
PR c++/35337
* semantics.c (finish_omp_clauses): Use %qD instead of %qE for
DECL_P in not a variable and appears more than once error messages.
complete_ctor_identifier,
t, inner_type, LOOKUP_NORMAL);
- if (targetm.cxx.cdtor_returns_this ())
+ if (targetm.cxx.cdtor_returns_this () || errorcount)
/* Because constructors and destructors return this,
the call will have been cast to "void". Remove the
cast here. We would like to use STRIP_NOPS, but it
t = build_special_member_call (t, complete_dtor_identifier,
NULL, inner_type, LOOKUP_NORMAL);
- if (targetm.cxx.cdtor_returns_this ())
+ if (targetm.cxx.cdtor_returns_this () || errorcount)
/* Because constructors and destructors return this,
the call will have been cast to "void". Remove the
cast here. We would like to use STRIP_NOPS, but it
--- /dev/null
+// PR c++/35328
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+struct A
+{
+ ~A ()(); // { dg-error "declared as function returning a function" }
+};
+struct B
+{
+ B ()(); // { dg-error "declared as function returning a function" }
+};
+struct C
+{
+ C ();
+ C (const C &)(); // { dg-error "declared as function returning a function" }
+};
+
+void
+foo ()
+{
+ A a;
+ B b;
+ C c;
+ #pragma omp parallel firstprivate (a)
+ ;
+ #pragma omp parallel private (b)
+ ;
+ #pragma omp parallel firstprivate (c)
+ ;
+}