From 6c1a068befd5ab60b44d7d3998c378c70e5ed663 Mon Sep 17 00:00:00 2001 From: jakub Date: Mon, 2 Jul 2007 12:59:49 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126201 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/semantics.c | 7 +++++-- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.dg/gomp/pr31748.C | 10 ++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/gomp/pr31748.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index aeb0e5c..b25e051 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2007-07-02 Jakub Jelinek + + 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 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index dc4a9f7..6b0d407 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3377,14 +3377,17 @@ finish_omp_clauses (tree clauses) { if (processing_template_decl) 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; } else if (bitmap_bit_p (&generic_head, DECL_UID (t)) || bitmap_bit_p (&firstprivate_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; } else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fee89cf..a4cfc1f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -3,6 +3,9 @@ * g++.dg/opt/nrv12.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 PR tree-optimization/32230 diff --git a/gcc/testsuite/g++.dg/gomp/pr31748.C b/gcc/testsuite/g++.dg/gomp/pr31748.C new file mode 100644 index 0000000..516978d --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr31748.C @@ -0,0 +1,10 @@ +// PR c++/31748 + +struct A; + +void +foo () +{ +#pragma omp parallel private(A) // { dg-error "struct A.*is not a variable" } + ; +} -- 2.7.4