File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9332,6 +9332,15 @@ void Tokenizer::reportUnknownMacros()
93329332 }
93339333 }
93349334 }
9335+
9336+ // String concatenation with unknown macros
9337+ for (const Token *tok = tokens (); tok; tok = tok->next ()) {
9338+ if (Token::Match (tok, " %str% %name% (" ) && Token::Match (tok->linkAt (2 ), " ) %str%" )) {
9339+ if (list.isKeyword (tok->next ()->str ()))
9340+ continue ;
9341+ unknownMacroError (tok->next ());
9342+ }
9343+ }
93359344}
93369345
93379346void Tokenizer::findGarbageCode () const
Original file line number Diff line number Diff line change @@ -7982,6 +7982,9 @@ class TestTokenizer : public TestFixture {
79827982
79837983 const char code2[] = " void foo() { dostuff(x 0); }" ;
79847984 ASSERT_THROW (tokenizeAndStringify (code2), InternalError);
7985+
7986+ const char code3[] = " f(\" 1\" __stringify(48) \" 1\" );" ;
7987+ ASSERT_THROW (tokenizeAndStringify (code3), InternalError);
79857988 }
79867989
79877990 void findGarbageCode () { // Test Tokenizer::findGarbageCode()
You can’t perform that action at this time.
0 commit comments