File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ unsigned int TemplateSimplifier::templateParameters(const Token *tok)
439439 // Skip variadic types (Ticket #5774, #6059, #6172)
440440 if (Token::simpleMatch (tok, " ..." )) {
441441 if ((tok->previous ()->isName () && !Token::Match (tok->tokAt (-2 ), " <|,|::" )) ||
442- (!tok->previous ()->isName () && !Token::Match (tok->previous (), " >|&|&&|*" )))
442+ (!tok->previous ()->isName () && !Token::Match (tok->previous (), " >|&|&&|*|) " )))
443443 return 0 ; // syntax error
444444 tok = tok->next ();
445445 if (!tok)
Original file line number Diff line number Diff line change @@ -4697,6 +4697,23 @@ class TestTokenizer : public TestFixture {
46974697 tokenizeAndStringify (code));
46984698 ASSERT_EQUALS (" " , errout_str ());
46994699 }
4700+ {
4701+ const char code[] = " namespace N {\n " // #15192
4702+ " template <typename... Ts>\n "
4703+ " struct S {};\n "
4704+ " }\n "
4705+ " template <typename... Ts, typename = N::S<decltype(Ts())...>>\n "
4706+ " void f() {}\n " ;
4707+ ASSERT_EQUALS (" namespace N {\n "
4708+ " template < typename ... Ts >\n "
4709+ " struct S { } ;\n "
4710+ " }\n "
4711+ " template < typename ... Ts , typename = N :: S < decltype ( Ts ( ) ) ... > >\n "
4712+ " void f ( ) { }" ,
4713+ tokenizeAndStringify (code));
4714+ ASSERT_EQUALS (" " , errout_str ());
4715+ }
4716+
47004717 }
47014718
47024719 void cpp03template1 () {
You can’t perform that action at this time.
0 commit comments