diff options
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 873e5a3..c100122 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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 of TT. To proper process the default argument of U, say when an instantiation `TT<int>' is seen, we need to build the full - arguments containing {int} as the innermost level. Outer levels - can be obtained from `current_template_args ()'. */ + arguments containing {int} as the innermost level. Outer levels, + 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); arglist2 = coerce_template_parms (parmlist, arglist, template, |