@@ -404,6 +404,8 @@ auto prefix_expression_node::visit(auto& v, int depth) -> void
404
404
}
405
405
406
406
407
+ struct template_args_tag { };
408
+
407
409
struct unqualified_id_node
408
410
{
409
411
token const * identifier = {}; // required
@@ -449,13 +451,16 @@ struct unqualified_id_node
449
451
v.start (*identifier, depth+1 );
450
452
451
453
if (!template_args.empty ()) {
454
+ // Inform the visitor that this is a template args list
455
+ v.start (template_args_tag{}, depth);
452
456
assert (open_angle != source_position{});
453
457
assert (close_angle != source_position{});
454
458
assert (template_args.front ().comma == source_position{});
455
459
for (auto & a : template_args) {
456
460
try_visit< expression>(a.arg , v, depth+1 );
457
461
try_visit<id_expression>(a.arg , v, depth+1 );
458
462
}
463
+ v.end (template_args_tag{}, depth);
459
464
}
460
465
461
466
v.end (*this , depth);
@@ -3257,6 +3262,11 @@ class parse_tree_printer : printing_visitor
3257
3262
o << pre (indent) << " function returns\n " ;
3258
3263
}
3259
3264
3265
+ auto start (template_args_tag const &, int indent) -> void
3266
+ {
3267
+ o << pre (indent) << " template arguments\n " ;
3268
+ }
3269
+
3260
3270
auto start (declaration_node const & n, int indent) -> void
3261
3271
{
3262
3272
o << pre (indent) << " declaration\n " ;
0 commit comments