Commit 342cea95 by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

re PR c++/6723 (ICE on source code successfully compiled by previous versions)

	PR c++/6723
	* pt.c (lookup_template_class): Don't build complete argument of
	BOUND_TEMPLATE_TEMPLATE_PARM if appeared as a default template
	argument.

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

From-SVN: r54831
parent 5bc93be5
2002-06-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/6723
* pt.c (lookup_template_class): Don't build complete argument of
BOUND_TEMPLATE_TEMPLATE_PARM if appeared as a default template
argument.
2002-06-19 Akim Demaille <akim@epita.fr> 2002-06-19 Akim Demaille <akim@epita.fr>
* parse.y (TYPENAME): Rename as tTYPENAME to avoid the clash with * parse.y (TYPENAME): Rename as tTYPENAME to avoid the clash with
......
...@@ -3967,10 +3967,16 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain) ...@@ -3967,10 +3967,16 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain)
The template parameter level of T and U are one level larger than The template parameter level of T and U are one level larger than
of TT. To proper process the default argument of U, say when an of TT. To proper process the default argument of U, say when an
instantiation `TT<int>' is seen, we need to build the full instantiation `TT<int>' is seen, we need to build the full
arguments containing {int} as the innermost level. Outer levels arguments containing {int} as the innermost level. Outer levels,
can be obtained from `current_template_args ()'. */ available when not appearing as default template argument, can be
obtained from `current_template_args ()'.
if (processing_template_decl) Suppose that TT is later substituted with std::vector. The above
instantiation is `TT<int, std::allocator<T> >' with TT at
level 1, and T at level 2, while the template arguments at level 1
becomes {std::vector} and the inner level 2 is {int}. */
if (current_template_parms)
arglist = add_to_template_args (current_template_args (), arglist); arglist = add_to_template_args (current_template_args (), arglist);
arglist2 = coerce_template_parms (parmlist, arglist, template, arglist2 = coerce_template_parms (parmlist, arglist, template,
......
2002-06-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
* g++.dg/template/ttp4.C: New test.
2002-06-19 Jakub Jelinek <jakub@redhat.com> 2002-06-19 Jakub Jelinek <jakub@redhat.com>
* g++.dg/opt/vt1.C: Fix regexp. * g++.dg/opt/vt1.C: Fix regexp.
......
// { dg-do compile }
// Origin: Ewgenij Gawrilow <gawrilow@math.tu-berlin.de>
// PR c++/6723
// ICE when default template argument contains instantiation of
// template template parameter.
template <typename A, typename B,
template <typename,typename> class Predicate,
bool _matches=Predicate<A,B>::answer>
struct helper { };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment