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(
20992099 Token * const beforeTypeToken = mTokenList .back ();
21002100 bool pointerType = false ;
21012101 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 (), " ...|< " ))
21032103 continue ;
21042104 if (isVariadicTemplateArg && Token::Match (tok3, " %name% ... %name%" ))
21052105 tok3 = tok3->tokAt (2 );
Original file line number Diff line number Diff line change @@ -6344,6 +6344,20 @@ class TestSimplifyTemplate : public TestFixture {
63446344 " } "
63456345 " } ;" ;
63466346 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));
63476361 }
63486362
63496363 void template_variable_1 () {
You can’t perform that action at this time.
0 commit comments