@@ -3828,7 +3828,8 @@ class cppfront
38283828 auto emit (
38293829 parameter_declaration_node const & n,
38303830 bool is_returns = false ,
3831- bool is_template_parameter = false
3831+ bool is_template_parameter = false ,
3832+ bool emit_identifier = true
38323833 )
38333834 -> void
38343835 {
@@ -3914,8 +3915,11 @@ class cppfront
39143915
39153916 if (n.declaration ->is_type ()) {
39163917 assert (n.declaration ->identifier );
3917- printer.print_cpp2 (" typename " , n.declaration ->identifier ->position ());
3918- emit (*n.declaration ->identifier );
3918+ printer.print_cpp2 (" typename" , n.declaration ->identifier ->position ());
3919+ if (emit_identifier) {
3920+ printer.print_cpp2 (" " , n.declaration ->identifier ->position ());
3921+ emit (*n.declaration ->identifier );
3922+ }
39193923 return ;
39203924 }
39213925
@@ -3925,9 +3929,12 @@ class cppfront
39253929 if (n.declaration ->is_template ()) {
39263930 assert (n.declaration ->identifier );
39273931 printer.print_cpp2 (" template " , n.declaration ->identifier ->position ());
3928- emit (*n.declaration ->template_parameters );
3929- printer.print_cpp2 (" class " , n.declaration ->identifier ->position ());
3930- emit (*n.declaration ->identifier );
3932+ emit (*n.declaration ->template_parameters , is_returns, true , false );
3933+ printer.print_cpp2 (" class" , n.declaration ->identifier ->position ());
3934+ if (emit_identifier) {
3935+ printer.print_cpp2 (" " , n.declaration ->identifier ->position ());
3936+ emit (*n.declaration ->identifier );
3937+ }
39313938 return ;
39323939 }
39333940
@@ -3939,9 +3946,11 @@ class cppfront
39393946
39403947 if (is_template_parameter) {
39413948 emit ( type_id );
3942- printer.print_cpp2 (" " , type_id.position ());
3943- assert (n.declaration ->identifier );
3944- emit (*n.declaration ->identifier );
3949+ if (emit_identifier) {
3950+ printer.print_cpp2 (" " , type_id.position ());
3951+ assert (n.declaration ->identifier );
3952+ emit (*n.declaration ->identifier );
3953+ }
39453954 return ;
39463955 }
39473956
@@ -4123,8 +4132,9 @@ class cppfront
41234132 //
41244133 auto emit (
41254134 parameter_declaration_list_node const & n,
4126- bool is_returns = false ,
4127- bool is_template_parameter = false
4135+ bool is_returns = false ,
4136+ bool is_template_parameter = false ,
4137+ bool emit_identifier = true
41284138 )
41294139 -> void
41304140 {
@@ -4152,7 +4162,7 @@ class cppfront
41524162 }
41534163 prev_pos = x->position ();
41544164 assert (x);
4155- emit (*x, is_returns, is_template_parameter);
4165+ emit (*x, is_returns, is_template_parameter, emit_identifier );
41564166 if (!x->declaration ->has_name (" this" )) {
41574167 first = false ;
41584168 }
0 commit comments