Fix #12006 Improve unknownMacro message (#5470)

This commit is contained in:
chrchr-github 2023-09-21 00:28:49 +02:00 committed by GitHub
parent 57bbb17f3b
commit dc59543348
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -8195,7 +8195,7 @@ void Tokenizer::reportUnknownMacros() const
if (Token::Match(inner, "[[({]"))
inner = inner->link();
else if (inner->str() == ";")
unknownMacroError(inner);
unknownMacroError(tok);
}
}

View File

@ -7039,6 +7039,10 @@ private:
"typedef int UStringCaseMapper(icu::BreakIterator* iter);\n"),
InternalError,
"There is an unknown macro here somewhere. Configuration is required. If U_ICU_ENTRY_POINT_RENAME is a macro then please configure it.");
ASSERT_THROW_EQUALS(tokenizeAndStringify("void f() { MACRO(x(), y(), \"abc\", z(); ok = true); }\n"), // #12006
InternalError,
"There is an unknown macro here somewhere. Configuration is required. If MACRO is a macro then please configure it.");
}