One more fix for #9354 (Unknown macro is not reported and then Cppcheck is silent about issues)
This commit is contained in:
parent
3b70a6868b
commit
033640310b
|
@ -5037,6 +5037,10 @@ void Tokenizer::removeMacrosInGlobalScope()
|
||||||
if (tok2 && tok2->str() == "(")
|
if (tok2 && tok2->str() == "(")
|
||||||
tok2 = tok2->link()->next();
|
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"))
|
if (Token::Match(tok, "%name% (") && Token::Match(tok2, "%name% *|&|::|<| %name%") && !Token::Match(tok2, "namespace|class|struct|union"))
|
||||||
unknownMacroError(tok);
|
unknownMacroError(tok);
|
||||||
|
|
||||||
|
|
|
@ -6419,6 +6419,13 @@ private:
|
||||||
"};"), InternalError);
|
"};"), InternalError);
|
||||||
|
|
||||||
ASSERT_THROW(tokenizeAndStringify("MACRO(test) void test() { }"), InternalError); // #7931
|
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
|
void removeMacroInVarDecl() { // #4304
|
||||||
|
|
Loading…
Reference in New Issue