Skip to content

Commit

Permalink
Fix #12006 Improve unknownMacro message (#5470)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Sep 20, 2023
1 parent 57bbb17 commit dc59543
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8195,7 +8195,7 @@ void Tokenizer::reportUnknownMacros() const
if (Token::Match(inner, "[[({]"))
inner = inner->link();
else if (inner->str() == ";")
unknownMacroError(inner);
unknownMacroError(tok);
}
}

Expand Down
4 changes: 4 additions & 0 deletions test/testtokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7039,6 +7039,10 @@ class TestTokenizer : public TestFixture {
"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.");
}


Expand Down

0 comments on commit dc59543

Please sign in to comment.