[clangd] Work around GCC bug 66735
authorSam McCall <sam.mccall@gmail.com>
Wed, 27 Jan 2021 14:32:05 +0000 (15:32 +0100)
committerSam McCall <sam.mccall@gmail.com>
Wed, 27 Jan 2021 14:32:05 +0000 (15:32 +0100)
clang-tools-extra/clangd/ParsedAST.cpp

index 403d3fe..1020282 100644 (file)
@@ -316,8 +316,8 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
       Check->registerMatchers(&CTFinder);
     }
 
-    ASTDiags.setLevelAdjuster([&, &Cfg(Config::current())](
-                                  DiagnosticsEngine::Level DiagLevel,
+    const Config& Cfg = Config::current();
+    ASTDiags.setLevelAdjuster([&](DiagnosticsEngine::Level DiagLevel,
                                   const clang::Diagnostic &Info) {
       if (Cfg.Diagnostics.SuppressAll ||
           isBuiltinDiagnosticSuppressed(Info.getID(), Cfg.Diagnostics.Suppress))