mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/17413 (local classes as template argument)
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. From-SVN: r94618
This commit is contained in:
parent
b5870beeee
commit
6c02751b14
|
|
@ -1,3 +1,9 @@
|
||||||
|
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>
|
2005-02-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||||
|
|
||||||
* cp-tree.h (complete_type_or_else): Remove macro.
|
* cp-tree.h (complete_type_or_else): Remove macro.
|
||||||
|
|
|
||||||
|
|
@ -8903,6 +8903,7 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain)
|
||||||
{
|
{
|
||||||
int ix, len = DECL_NTPARMS (tmpl);
|
int ix, len = DECL_NTPARMS (tmpl);
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
bool error_p = complain & tf_error;
|
||||||
|
|
||||||
for (ix = 0; ix != len; ix++)
|
for (ix = 0; ix != len; ix++)
|
||||||
{
|
{
|
||||||
|
|
@ -8920,10 +8921,11 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain)
|
||||||
if (nt)
|
if (nt)
|
||||||
{
|
{
|
||||||
if (TYPE_ANONYMOUS_P (nt))
|
if (TYPE_ANONYMOUS_P (nt))
|
||||||
error ("%qT uses anonymous type", t);
|
error ("%qT is/uses anonymous type", t);
|
||||||
else
|
else
|
||||||
error ("%qT uses local type %qT", t, nt);
|
error ("%qT uses local type %qT", t, nt);
|
||||||
result = true;
|
result = true;
|
||||||
|
error_p = true;
|
||||||
}
|
}
|
||||||
/* In order to avoid all sorts of complications, we do not
|
/* In order to avoid all sorts of complications, we do not
|
||||||
allow variably-modified types as template arguments. */
|
allow variably-modified types as template arguments. */
|
||||||
|
|
@ -8945,7 +8947,7 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain)
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result && complain & tf_error)
|
if (result && error_p)
|
||||||
error (" trying to instantiate %qD", tmpl);
|
error (" trying to instantiate %qD", tmpl);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>
|
2005-02-02 Richard Sandiford <rsandifo@redhat.com>
|
||||||
|
|
||||||
PR tree-optimization/19578
|
PR tree-optimization/19578
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,5 @@ int main () {
|
||||||
// We do not simply use "local|match" on line 10 because we want to
|
// We do not simply use "local|match" on line 10 because we want to
|
||||||
// make sure that "local" appears.
|
// make sure that "local" appears.
|
||||||
// { dg-error "local" "" { target *-*-* } 10 }
|
// { dg-error "local" "" { target *-*-* } 10 }
|
||||||
foo<S> (); // { dg-error "match" }
|
foo<S> (); // { dg-error "trying|match" }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue