parent
e293b66ac6
commit
51b4cf592b
|
@ -10196,10 +10196,12 @@ void Tokenizer::reportUnknownMacros() const
|
||||||
unknownMacroError(tok);
|
unknownMacroError(tok);
|
||||||
}
|
}
|
||||||
} else if (Token::Match(tok, "%name% (") && tok->isUpperCaseName() && Token::Match(tok->linkAt(1), ") %name% (") && Token::Match(tok->linkAt(1)->linkAt(2), ") [;{]")) {
|
} else if (Token::Match(tok, "%name% (") && tok->isUpperCaseName() && Token::Match(tok->linkAt(1), ") %name% (") && Token::Match(tok->linkAt(1)->linkAt(2), ") [;{]")) {
|
||||||
if (possible.count(tok->str()) == 0)
|
if (!(tok->linkAt(1)->next() && tok->linkAt(1)->next()->isKeyword())) { // e.g. noexcept(true)
|
||||||
possible.insert(tok->str());
|
if (possible.count(tok->str()) == 0)
|
||||||
else
|
possible.insert(tok->str());
|
||||||
unknownMacroError(tok);
|
else
|
||||||
|
unknownMacroError(tok);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6551,6 +6551,9 @@ private:
|
||||||
|
|
||||||
const char code10[] = "void f(std::exception c) { b(M() M() + N(c.what())); }";
|
const char code10[] = "void f(std::exception c) { b(M() M() + N(c.what())); }";
|
||||||
ASSERT_THROW(tokenizeAndStringify(code10), InternalError);
|
ASSERT_THROW(tokenizeAndStringify(code10), InternalError);
|
||||||
|
|
||||||
|
const char code11[] = "struct B { B(B&&) noexcept {} ~B() noexcept {} };";
|
||||||
|
ASSERT_NO_THROW(tokenizeAndStringify(code11));
|
||||||
}
|
}
|
||||||
|
|
||||||
void findGarbageCode() { // Test Tokenizer::findGarbageCode()
|
void findGarbageCode() { // Test Tokenizer::findGarbageCode()
|
||||||
|
|
Loading…
Reference in New Issue