PR c++/10555, c++/10576

PR c++/10555, c++/10576
	* pt.c (lookup_template_class): Handle class template with
	multiple levels of parameters when one of the levels contain
	errors.

	* g++.dg/template/memclass1.C: New test.

From-SVN: r66634
This commit is contained in:
Kriang Lerdsuwanakij 2003-05-09 15:10:28 +00:00 committed by Kriang Lerdsuwanakij
parent f4e12a7cdb
commit 88e98cfeb7
4 changed files with 39 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2003-05-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/10555, c++/10576
* pt.c (lookup_template_class): Handle class template with
multiple levels of parameters when one of the levels contain
errors.
2003-05-08 Jason Merrill <jason@redhat.com>
* init.c (build_new_1): Don't reuse a TARGET_EXPR in an

View File

@ -4251,6 +4251,15 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain)
tree a = coerce_template_parms (TREE_VALUE (t),
arglist, template,
complain, /*require_all_args=*/1);
/* Don't process further if one of the levels fails. */
if (a == error_mark_node)
{
/* Restore the ARGLIST to its full size. */
TREE_VEC_LENGTH (arglist) = saved_depth;
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
}
SET_TMPL_ARGS_LEVEL (bound_args, i, a);
/* We temporarily reduce the length of the ARGLIST so

View File

@ -1,3 +1,8 @@
2003-05-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/10555, c++/10576
* g++.dg/template/memclass1.C: New test.
2003-05-08 DJ Delorie <dj@redhat.com>
* gcc.c-torture/execute/20020404-1.x: New, skip for 16-bit

View File

@ -0,0 +1,18 @@
// { dg-do compile }
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// PR c++/10555: ICE for member class template when one of the
// template argument levels contains errors.
template <typename> struct A
{
template <typename> struct B;
};
template <typename T> struct C
{
typedef typename A<T>::template B<U> X; // { dg-error "declared|invalid" }
};
C<void> c; // { dg-error "instantiated" }