File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5544,7 +5544,7 @@ void Tokenizer::createLinks2()
55445544
55455545 while (!type.empty () && type.top ()->str () == " <" ) {
55465546 const Token* end = type.top ()->findClosingBracket ();
5547- if (Token::Match (end, " > %comp%|;|.|=|{|(|::" ))
5547+ if (Token::Match (end, " > %comp%|;|.|=|{|(|)| ::" ))
55485548 break ;
55495549 // Variable declaration
55505550 if (Token::Match (end, " > %var% ;" ) && (type.top ()->tokAt (-2 ) == nullptr || Token::Match (type.top ()->tokAt (-2 ), " ;|}|{" )))
Original file line number Diff line number Diff line change @@ -3829,6 +3829,19 @@ class TestTokenizer : public TestFixture {
38293829 ASSERT_EQUALS (true , tok1->link () == tok2);
38303830 ASSERT_EQUALS (true , tok2->link () == tok1);
38313831 }
3832+
3833+ {
3834+ const char code[] = " template <typename Fn, typename... Args>\n " // #14612
3835+ " void f(Fn && fn, Args&&... args) {\n "
3836+ " static_assert(std::is_invocable_v<Fn&&, Args&&...>);\n "
3837+ " }\n " ;
3838+ SimpleTokenizer tokenizer (settings0, *this );
3839+ ASSERT (tokenizer.tokenize (code));
3840+ const Token* tok1 = Token::findsimplematch (tokenizer.tokens (), " < Fn" );
3841+ const Token* tok2 = Token::findsimplematch (tok1, " > )" );
3842+ ASSERT_EQUALS (true , tok1->link () == tok2);
3843+ ASSERT_EQUALS (true , tok2->link () == tok1);
3844+ }
38323845 }
38333846
38343847 void simplifyString () {
You can’t perform that action at this time.
0 commit comments