aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index bb4515b..c3c759e 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -19315,7 +19315,12 @@ splice_late_return_type (tree type, tree late_return_type)
return type;
argvec = make_tree_vec (1);
TREE_VEC_ELT (argvec, 0) = late_return_type;
- if (processing_template_decl)
+ if (processing_template_parmlist)
+ /* For a late-specified return type in a template type-parameter, we
+ need to add a dummy argument level for its parmlist. */
+ argvec = add_to_template_args
+ (make_tree_vec (processing_template_parmlist), argvec);
+ if (current_template_parms)
argvec = add_to_template_args (current_template_args (), argvec);
return tsubst (type, argvec, tf_warning_or_error, NULL_TREE);
}