diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-07-02 14:59:49 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-07-02 14:59:49 +0200 |
commit | 76dc15d4539e501051e446382de43f3e876e49f2 (patch) | |
tree | f0b23705d0b7856c7430af5a899f16e495c874ff /gcc/cp | |
parent | a2daf82cc26803dcf11ec3972fcd317680b424ed (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 7 |
2 files changed, 11 insertions, 2 deletions
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 <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> * 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 |