This is an archive of the discontinued LLVM Phabricator instance.

[clang-format][tests] Fix MacroExpander lexer not parsing C++ keywords
ClosedPublic

Authored by arichardson on Oct 7 2020, 3:15 AM.

Details

Summary

While debugging a different clang-format failure, I tried to reuse the
MacroExpander lexer, but was surprised to see that it marks all C++
keywords (e.g. const, decltype) as being of type identifier. After stepping
through the ::format() code, I noticed that the difference between these
two is that the identifier table was not being initialized based on the
FormatStyle, so only basic tokens such as tok::semi, tok::plus, etc. were
being handled.

Diff Detail