sammccall marked an inline comment as done.
sammccall added inline comments.


================
Comment at: clangd/index/IndexAction.cpp:140
+    // Avoids some analyses too.
+    CI.getDiagnosticOpts().IgnoreWarnings = true;
     return WrapperFrontendAction::BeginInvocation(CI);
----------------
hokein wrote:
> Can we add a unittest for this?
> 
> IIRC, `IgnoreWarnings` option must be set before `CompilerInstance` is 
> created, otherwise it doesn't take affect, see 
> https://github.com/llvm-mirror/clang-tools-extra/blob/master/clangd/CodeComplete.cpp#L1029
Added test, thanks.

You're right, the flag has already been copied to the diagnostics client. It's 
too late to set it here.

Unfortunately we don't control where the CompilerInstance is created, but this 
is semantically the right layer to make the decision to suppress warnings. So 
I've just set it on the diagnostics client too :-/


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D59935



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to