diff options
author | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-02 21:58:46 +0000 |
---|---|---|
committer | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-02 21:58:46 +0000 |
commit | 066cf3d35e319b06303a5cdfed830779f5c9bdd1 (patch) | |
tree | c59586e3e6430820b1419013af9228ee2f7302f5 | |
parent | 14f96a2b6af5d56c93939011cd7cb6b58e0e0f36 (diff) | |
download | gcc-066cf3d35e319b06303a5cdfed830779f5c9bdd1.tar.gz |
PR c++/17413
* pt.c (check_instantiated_args): Improve error message.
Fix logic when to print its second part.
PR c++/17413
* g++.dg/template/local4.C: Tweak.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94618 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/local4.C | 2 |
4 files changed, 16 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 284a93315a6..0aca2e0136e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2005-02-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + PR c++/17413 + * pt.c (check_instantiated_args): Improve error message. + Fix logic when to print its second part. + +2005-02-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + * cp-tree.h (complete_type_or_else): Remove macro. (complete_type_or_diagnostic): Rename to complete_type_or_else and remove last argument. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 3252f368fc2..0e6ce130f8d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8903,6 +8903,7 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain) { int ix, len = DECL_NTPARMS (tmpl); bool result = false; + bool error_p = complain & tf_error; for (ix = 0; ix != len; ix++) { @@ -8920,10 +8921,11 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain) if (nt) { if (TYPE_ANONYMOUS_P (nt)) - error ("%qT uses anonymous type", t); + error ("%qT is/uses anonymous type", t); else error ("%qT uses local type %qT", t, nt); result = true; + error_p = true; } /* In order to avoid all sorts of complications, we do not allow variably-modified types as template arguments. */ @@ -8945,7 +8947,7 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain) result = true; } } - if (result && complain & tf_error) + if (result && error_p) error (" trying to instantiate %qD", tmpl); return result; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a1dbc3fb03f..e83ff1a7800 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-02-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + + PR c++/17413 + * g++.dg/template/local4.C: Tweak. + 2005-02-02 Richard Sandiford <rsandifo@redhat.com> PR tree-optimization/19578 diff --git a/gcc/testsuite/g++.dg/template/local4.C b/gcc/testsuite/g++.dg/template/local4.C index 53a51982161..748810b409e 100644 --- a/gcc/testsuite/g++.dg/template/local4.C +++ b/gcc/testsuite/g++.dg/template/local4.C @@ -7,5 +7,5 @@ int main () { // We do not simply use "local|match" on line 10 because we want to // make sure that "local" appears. // { dg-error "local" "" { target *-*-* } 10 } - foo<S> (); // { dg-error "match" } + foo<S> (); // { dg-error "trying|match" } } |