forked from OSchip/llvm-project
[NFC] Don't pass temporary LangOptions to Lexer
Since https://reviews.llvm.org/D120334, passing a temporary LangOptions object to Lexer results in stack-use-after-scope.
This commit is contained in:
parent
f1315c61a0
commit
de9611befe
clang-tools-extra/clangd
|
@ -25,8 +25,8 @@ void closeBrackets(std::string &Code, const format::FormatStyle &Style) {
|
|||
SourceManagerForFile FileSM("mock_file.cpp", Code);
|
||||
auto &SM = FileSM.get();
|
||||
FileID FID = SM.getMainFileID();
|
||||
Lexer Lex(FID, SM.getBufferOrFake(FID), SM,
|
||||
format::getFormattingLangOpts(Style));
|
||||
LangOptions LangOpts = format::getFormattingLangOpts(Style);
|
||||
Lexer Lex(FID, SM.getBufferOrFake(FID), SM, LangOpts);
|
||||
Token Tok;
|
||||
std::vector<char> Brackets;
|
||||
while (!Lex.LexFromRawLexer(Tok)) {
|
||||
|
|
Loading…
Reference in New Issue