@@ -4454,15 +4454,6 @@ class parser
4454
4454
// Remember current position, in case this < is isn't a template argument list
4455
4455
auto start_pos = pos;
4456
4456
4457
- // And since we'll do this in two places, factor it into a local function
4458
- auto back_out_template_arg_list = [&]{
4459
- // Aha, this wasn't a template argument list after all,
4460
- // so back out just that part and return the identifier
4461
- n->open_angle = source_position{};
4462
- n->template_args .clear ();
4463
- pos = start_pos;
4464
- };
4465
-
4466
4457
n->open_angle = curr ().position ();
4467
4458
next ();
4468
4459
@@ -4477,8 +4468,7 @@ class parser
4477
4468
term.arg = std::move (i);
4478
4469
}
4479
4470
else {
4480
- back_out_template_arg_list ();
4481
- return n;
4471
+ break ;
4482
4472
}
4483
4473
n->template_args .push_back ( std::move (term) );
4484
4474
}
@@ -4492,7 +4482,11 @@ class parser
4492
4482
// next term.comma = curr().position();
4493
4483
4494
4484
if (curr ().type () != lexeme::Greater) {
4495
- back_out_template_arg_list ();
4485
+ // Aha, this wasn't a template argument list after all,
4486
+ // so back out just that part and return the identifier
4487
+ n->open_angle = source_position{};
4488
+ n->template_args .clear ();
4489
+ pos = start_pos;
4496
4490
return n;
4497
4491
}
4498
4492
n->close_angle = curr ().position ();
0 commit comments