One more fix for #9354 (Unknown macro is not reported and then Cppcheck is silent about issues)

This commit is contained in:
Daniel Marjamäki 2019-09-15 21:07:20 +02:00
parent 3b70a6868b
commit 033640310b
2 changed files with 11 additions and 0 deletions

View File

@ -5037,6 +5037,10 @@ void Tokenizer::removeMacrosInGlobalScope()
if (tok2 && tok2->str() == "(")
tok2 = tok2->link()->next();
// Several unknown macros...
while (Token::Match(tok2, "%type% (") && tok2->isUpperCaseName())
tok2 = tok2->linkAt(1)->next();
if (Token::Match(tok, "%name% (") && Token::Match(tok2, "%name% *|&|::|<| %name%") && !Token::Match(tok2, "namespace|class|struct|union"))
unknownMacroError(tok);

View File

@ -6419,6 +6419,13 @@ private:
"};"), InternalError);
ASSERT_THROW(tokenizeAndStringify("MACRO(test) void test() { }"), InternalError); // #7931
ASSERT_THROW(tokenizeAndStringify("BEGIN_MESSAGE_MAP(CSetProgsAdvDlg, CResizableStandAloneDialog)\n"
" ON_BN_CLICKED(IDC_ADDTOOL, OnBnClickedAddtool)\n"
"END_MESSAGE_MAP()\n"
"\n"
"BOOL CSetProgsAdvDlg::OnInitDialog() {}"),
InternalError);
}
void removeMacroInVarDecl() { // #4304