Commit 76dc15d4 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/31748 (bad diagnostic for invalid private clause)

	PR c++/31748
	* semantics.c (finish_omp_clauses): Use %qD instead of %qE for
	DECL_P in not a variable and appears more than once error messages.

	* g++.dg/gomp/pr31748.C: New test.

From-SVN: r126201
parent a2daf82c
2007-07-02 Jakub Jelinek <jakub@redhat.com>
PR c++/31748
* semantics.c (finish_omp_clauses): Use %qD instead of %qE for
DECL_P in not a variable and appears more than once error messages.
2007-07-01 Ollie Wild <aaw@google.com> 2007-07-01 Ollie Wild <aaw@google.com>
* name-lookup.c (ambiguous_decl): Fix case when new->value is hidden. * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
......
...@@ -3377,14 +3377,17 @@ finish_omp_clauses (tree clauses) ...@@ -3377,14 +3377,17 @@ finish_omp_clauses (tree clauses)
{ {
if (processing_template_decl) if (processing_template_decl)
break; break;
error ("%qE is not a variable in clause %qs", t, name); if (DECL_P (t))
error ("%qD is not a variable in clause %qs", t, name);
else
error ("%qE is not a variable in clause %qs", t, name);
remove = true; remove = true;
} }
else if (bitmap_bit_p (&generic_head, DECL_UID (t)) else if (bitmap_bit_p (&generic_head, DECL_UID (t))
|| bitmap_bit_p (&firstprivate_head, DECL_UID (t)) || bitmap_bit_p (&firstprivate_head, DECL_UID (t))
|| bitmap_bit_p (&lastprivate_head, DECL_UID (t))) || bitmap_bit_p (&lastprivate_head, DECL_UID (t)))
{ {
error ("%qE appears more than once in data clauses", t); error ("%qD appears more than once in data clauses", t);
remove = true; remove = true;
} }
else else
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
* g++.dg/opt/nrv12.C: New test. * g++.dg/opt/nrv12.C: New test.
* gcc.target/i386/nrv1.c: New test. * gcc.target/i386/nrv1.c: New test.
PR c++/31748
* g++.dg/gomp/pr31748.C: New test.
2007-07-02 Ira Rosen <irar@il.ibm.com> 2007-07-02 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/32230 PR tree-optimization/32230
// PR c++/31748
struct A;
void
foo ()
{
#pragma omp parallel private(A) // { dg-error "struct A.*is not a variable" }
;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment