File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5647,6 +5647,8 @@ void Tokenizer::createLinks2()
56475647 const Token* end = type.top ()->findClosingBracket ();
56485648 if (Token::Match (end, " > %comp%|;|.|=|{|}|(|)|::" ))
56495649 break ;
5650+ if (Token::Match (end, " > %name% (" ))
5651+ break ;
56505652 // Variable declaration
56515653 if (Token::Match (end, " > %var% ;" ) && (type.top ()->tokAt (-2 ) == nullptr || Token::Match (type.top ()->tokAt (-2 ), " ;|}|{" )))
56525654 break ;
Original file line number Diff line number Diff line change @@ -3933,6 +3933,16 @@ class TestTokenizer : public TestFixture {
39333933 ASSERT_EQUALS (true , tok1->link () == tok2);
39343934 ASSERT_EQUALS (true , tok2->link () == tok1);
39353935 }
3936+
3937+ {
3938+ const char code[] = " std::enable_if_t<0 || 1, void> f() {}\n " ; // #14982
3939+ SimpleTokenizer tokenizer (settingsDefault, *this );
3940+ ASSERT (tokenizer.tokenize (code));
3941+ const Token* tok1 = Token::findsimplematch (tokenizer.tokens (), " < 0" );
3942+ const Token* tok2 = Token::findsimplematch (tok1, " > f" );
3943+ ASSERT_EQUALS (true , tok1->link () == tok2);
3944+ ASSERT_EQUALS (true , tok2->link () == tok1);
3945+ }
39363946 }
39373947
39383948 void simplifyString () {
You can’t perform that action at this time.
0 commit comments