[PATCH] D95349: [clangd] Allow diagnostics to be suppressed with configuration

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 27 06:10:33 PST 2021


ArcsinX added inline comments.


================
Comment at: clang-tools-extra/clangd/ParsedAST.cpp:319
 
-    if (!CTChecks.empty()) {
-      ASTDiags.setLevelAdjuster([&CTContext](DiagnosticsEngine::Level DiagLevel,
-                                             const clang::Diagnostic &Info) {
+    ASTDiags.setLevelAdjuster([&, &Cfg(Config::current())](
+                                  DiagnosticsEngine::Level DiagLevel,
----------------
This line breaks GCC 5.4 build with the following log:
```
llvm-project/clang-tools-extra/clangd/ParsedAST.cpp:319:55: error: binding ‘const clang::clangd::Config’ to reference of type ‘clang::clangd::Config&’ discards qualifiers
     ASTDiags.setLevelAdjuster([&, &Cfg(Config::current())](
                                                       ^
```
Unsure is it a compiler bug or not. Moving `Cfg` out of the capture list or using a cast to `Config &` solves the problem.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95349/new/

https://reviews.llvm.org/D95349



More information about the cfe-commits mailing list