aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-02 14:59:49 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2007-07-02 14:59:49 +0200
commit76dc15d4539e501051e446382de43f3e876e49f2 (patch)
treef0b23705d0b7856c7430af5a899f16e495c874ff /gcc/cp/semantics.c
parenta2daf82cc26803dcf11ec3972fcd317680b424ed (diff)
downloadgcc-76dc15d4539e501051e446382de43f3e876e49f2.zip
gcc-76dc15d4539e501051e446382de43f3e876e49f2.tar.gz
gcc-76dc15d4539e501051e446382de43f3e876e49f2.tar.bz2
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
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c7
1 files changed, 5 insertions, 2 deletions
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