Tokenizer: do not report unknownMacro for alignas (#5058)
This commit is contained in:
parent
cf4d59a835
commit
793d6aef01
|
@ -8006,6 +8006,8 @@ static bool isNonMacro(const Token* tok)
|
||||||
return true;
|
return true;
|
||||||
if (tok->str().compare(0, 2, "__") == 0) // attribute/annotation
|
if (tok->str().compare(0, 2, "__") == 0) // attribute/annotation
|
||||||
return true;
|
return true;
|
||||||
|
if (Token::simpleMatch(tok, "alignas ("))
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6770,6 +6770,8 @@ private:
|
||||||
|
|
||||||
const char code11[] = "struct B { B(B&&) noexcept {} ~B() noexcept {} };";
|
const char code11[] = "struct B { B(B&&) noexcept {} ~B() noexcept {} };";
|
||||||
ASSERT_NO_THROW(tokenizeAndStringify(code11));
|
ASSERT_NO_THROW(tokenizeAndStringify(code11));
|
||||||
|
|
||||||
|
ASSERT_NO_THROW(tokenizeAndStringify("alignas(8) alignas(16) int x;")); // alignas is not unknown macro
|
||||||
}
|
}
|
||||||
|
|
||||||
void findGarbageCode() { // Test Tokenizer::findGarbageCode()
|
void findGarbageCode() { // Test Tokenizer::findGarbageCode()
|
||||||
|
|
Loading…
Reference in New Issue