File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9346,7 +9346,8 @@ void Tokenizer::findGarbageCode() const
93469346 while (prev && prev->isName ())
93479347 prev = prev->previous ();
93489348 if (Token::Match (prev, " %op%|%num%|%str%|%char%" )) {
9349- if (!Token::simpleMatch (tok->tokAt (-2 ), " operator \"\" if" ))
9349+ if (!Token::simpleMatch (tok->tokAt (-2 ), " operator \"\" if" ) &&
9350+ !Token::simpleMatch (tok->tokAt (-2 ), " extern \" C\" " ) )
93509351 syntaxError (tok, prev == tok->previous () ? (prev->str () + " " + tok->str ()) : (prev->str () + " .. " + tok->str ()));
93519352 }
93529353 }
Original file line number Diff line number Diff line change @@ -7959,6 +7959,8 @@ class TestTokenizer : public TestFixture {
79597959
79607960 ASSERT_NO_THROW (tokenizeAndStringify (" S s = { .x=2, .y[0]=3 };" ));
79617961 ASSERT_NO_THROW (tokenizeAndStringify (" S s = { .ab.a=2, .ab.b=3 };" ));
7962+
7963+ ASSERT_NO_THROW (tokenizeAndStringify (" extern \" C\" typedef void FUNC();" ));
79627964 }
79637965
79647966
You can’t perform that action at this time.
0 commit comments