Skip to content

Commit 0091893

Browse files
committed
[clang-format] Undo the change to TestLexer() in commit 32e65b0
We can't skip calling getFormattingLangOpts() because LangOpts is not initialized in the unit tests.
1 parent da9559d commit 0091893

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clang/unittests/Format/TestLexer.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ class TestLexer : public UnwrappedLineConsumer {
6161
std::vector<std::unique_ptr<llvm::MemoryBuffer>> &Buffers,
6262
FormatStyle Style = getLLVMStyle())
6363
: Allocator(Allocator), Buffers(Buffers), Style(Style),
64-
SourceMgr("test.cpp", ""), IdentTable(LangOpts) {
65-
assert(LangOpts.CPlusPlus);
66-
}
64+
SourceMgr("test.cpp", ""), IdentTable(getFormattingLangOpts(Style)) {}
6765

6866
TokenList lex(llvm::StringRef Code) {
6967
FormatTokenLexer Lex = getNewLexer(Code);

0 commit comments

Comments
 (0)