re PR c++/35828 ([C++0x] ICE on default template template parameter in template function)
PR c++/35828 * pt.c (tsubst_decl): Don't abort if we didn't change anything in a TEMPLATE_DECL's args. From-SVN: r149353
This commit is contained in:
parent
0ad8c85546
commit
be5b9bce0a
|
@ -1,5 +1,9 @@
|
|||
2009-07-07 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/35828
|
||||
* pt.c (tsubst_decl): Don't abort if we didn't change anything
|
||||
in a TEMPLATE_DECL's args.
|
||||
|
||||
PR c++/37816
|
||||
* decl.c (build_enumerator): Don't add enumerators for a
|
||||
scoped enum to the enclosing class.
|
||||
|
|
11
gcc/cp/pt.c
11
gcc/cp/pt.c
|
@ -8059,8 +8059,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
|
|||
case TEMPLATE_DECL:
|
||||
{
|
||||
/* We can get here when processing a member function template,
|
||||
member class template, and template template parameter of
|
||||
a template class. */
|
||||
member class template, or template template parameter. */
|
||||
tree decl = DECL_TEMPLATE_RESULT (t);
|
||||
tree spec;
|
||||
tree tmpl_args;
|
||||
|
@ -8103,10 +8102,10 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
|
|||
if (full_args == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
/* tsubst_template_args doesn't copy the vector if
|
||||
nothing changed. But, *something* should have
|
||||
changed. */
|
||||
gcc_assert (full_args != tmpl_args);
|
||||
/* If this is a default template template argument,
|
||||
tsubst might not have changed anything. */
|
||||
if (full_args == tmpl_args)
|
||||
return t;
|
||||
|
||||
spec = retrieve_specialization (t, full_args,
|
||||
/*class_specializations_p=*/true);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
2009-07-07 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/35828
|
||||
* g++.dg/template/defarg12.C: New.
|
||||
|
||||
PR c++/37816
|
||||
* g++.dg/cpp0x/enum7.C: New.
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
// PR c++/35828
|
||||
// { dg-options "-std=c++0x" }
|
||||
|
||||
template < typename > struct A ;
|
||||
template < template < typename > class = A >
|
||||
void test ()
|
||||
{
|
||||
test ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue