File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8246,7 +8246,8 @@ void Tokenizer::findGarbageCode() const
82468246 prev = prev->previous ();
82478247 if (Token::Match (prev, " %op%|%num%|%str%|%char%" )) {
82488248 if (!Token::simpleMatch (tok->tokAt (-2 ), " operator \"\" if" ) &&
8249- !Token::simpleMatch (tok->tokAt (-2 ), " extern \" C\" " ))
8249+ !Token::simpleMatch (tok->tokAt (-2 ), " extern \" C\" " ) &&
8250+ !Token::simpleMatch (prev, " > typedef" ))
82508251 syntaxError (tok, prev == tok->previous () ? (prev->str () + " " + tok->str ()) : (prev->str () + " .. " + tok->str ()));
82518252 }
82528253 }
Original file line number Diff line number Diff line change @@ -6918,6 +6918,9 @@ class TestTokenizer : public TestFixture {
69186918 ASSERT_NO_THROW (tokenizeAndStringify (" template <class T> constexpr int n = 1;\n "
69196919 " template <class T> T a[n<T>];\n " ));
69206920
6921+ ASSERT_EQUALS (" std :: vector < int > x ;" , // #11785
6922+ tokenizeAndStringify (" std::vector<int> typedef v; v x;\n " ));
6923+
69216924
69226925 // op op
69236926 ASSERT_THROW_EQUALS (tokenizeAndStringify (" void f() { dostuff (x==>y); }" ), InternalError, " syntax error: == >" );
You can’t perform that action at this time.
0 commit comments