File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -2099,7 +2099,7 @@ void TemplateSimplifier::expandTemplate(
2099
2099
Token * const beforeTypeToken = mTokenList .back ();
2100
2100
bool pointerType = false ;
2101
2101
const bool isVariadicTemplateArg = templateDeclaration.isVariadic () && itype + 1 == typeParametersInDeclaration.size ();
2102
- if (isVariadicTemplateArg && mTypesUsedInTemplateInstantiation .size () > 1 && !Token::simpleMatch (tok3->next (), " ..." ))
2102
+ if (isVariadicTemplateArg && mTypesUsedInTemplateInstantiation .size () > 1 && !Token::Match (tok3->next (), " ...|< " ))
2103
2103
continue ;
2104
2104
if (isVariadicTemplateArg && Token::Match (tok3, " %name% ... %name%" ))
2105
2105
tok3 = tok3->tokAt (2 );
Original file line number Diff line number Diff line change @@ -6344,6 +6344,20 @@ class TestSimplifyTemplate : public TestFixture {
6344
6344
" } "
6345
6345
" } ;" ;
6346
6346
ASSERT_EQUALS (expected, tok (code));
6347
+
6348
+ const char code2[] = " template <typename T>\n " // #13929
6349
+ " struct S {};\n "
6350
+ " template <typename T, template<typename...> typename C = S>\n "
6351
+ " struct A {\n "
6352
+ " using x = C<T>;\n "
6353
+ " };\n "
6354
+ " A<int> a;\n " ;
6355
+ const char expected2[] = " template < typename T > "
6356
+ " struct S { } ; "
6357
+ " struct A<int,S> ; "
6358
+ " A<int,S> a ; "
6359
+ " struct A<int,S> { } ;" ;
6360
+ ASSERT_EQUALS (expected2, tok (code2));
6347
6361
}
6348
6362
6349
6363
void template_variable_1 () {
You can’t perform that action at this time.
0 commit comments