diff --git a/clang/unittests/Format/TestLexer.h b/clang/unittests/Format/TestLexer.h index 6a3d0bdedcee0..8b5949b32fc9e 100644 --- a/clang/unittests/Format/TestLexer.h +++ b/clang/unittests/Format/TestLexer.h @@ -61,9 +61,7 @@ class TestLexer : public UnwrappedLineConsumer { std::vector> &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);