Skip to content

Commit

Permalink
[clang-format] Undo the change to TestLexer() in commit 32e65b0
Browse files Browse the repository at this point in the history
We can't skip calling getFormattingLangOpts() because LangOpts is not
initialized in the unit tests.
  • Loading branch information
owenca committed Feb 12, 2024
1 parent da9559d commit 0091893
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions clang/unittests/Format/TestLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ class TestLexer : public UnwrappedLineConsumer {
std::vector<std::unique_ptr<llvm::MemoryBuffer>> &Buffers,
FormatStyle Style = getLLVMStyle())
: Allocator(Allocator), Buffers(Buffers), Style(Style),
SourceMgr("test.cpp", ""), IdentTable(LangOpts) {
assert(LangOpts.CPlusPlus);
}
SourceMgr("test.cpp", ""), IdentTable(getFormattingLangOpts(Style)) {}

TokenList lex(llvm::StringRef Code) {
FormatTokenLexer Lex = getNewLexer(Code);
Expand Down

0 comments on commit 0091893

Please sign in to comment.