File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 @@ -6334,6 +6334,20 @@ class TestSimplifyTemplate : public TestFixture {
63346334 " } "
63356335 " } ;" ;
63366336 ASSERT_EQUALS (expected, tok (code));
6337+
6338+ const char code2[] = " template <typename T>\n " // #13929
6339+ " struct S {};\n "
6340+ " template <typename T, template<typename...> typename C = S>\n "
6341+ " struct A {\n "
6342+ " using x = C<T>;\n "
6343+ " };\n "
6344+ " A<int> a;\n " ;
6345+ const char expected2[] = " template < typename T > "
6346+ " struct S { } ; "
6347+ " struct A<int,S> ; "
6348+ " A<int,S> a ; "
6349+ " struct A<int,S> { } ;" ;
6350+ ASSERT_EQUALS (expected2, tok (code2));
63376351 }
63386352
63396353 void template_variable_1 () {
You can’t perform that action at this time.
0 commit comments