diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 749710867..01945aae5 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -8195,7 +8195,7 @@ void Tokenizer::reportUnknownMacros() const if (Token::Match(inner, "[[({]")) inner = inner->link(); else if (inner->str() == ";") - unknownMacroError(inner); + unknownMacroError(tok); } } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index e5814f6e5..552a2a30b 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -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."); }