This would fix that we show weird diagnostics on random lines of the main file.
Details
- Reviewers
ilya-biryukov - Commits
- rGf44fc8869c16: Merging r368549: --------------------------------------------------------------…
rL368683: Merging r368549:
rGd614a65d85c1: [clangd] Drop diags from non-written #include.
rCTE368549: [clangd] Drop diags from non-written #include.
rL368549: [clangd] Drop diags from non-written #include.
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 36587 Build 36586: arc lint + arc unit
Event Timeline
LGTM, thanks!
We should also merge this into the release branch if it's not too late yet.
clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp | ||
---|---|---|
952 | Could you add a comment describing which diagnostic we do not want to see here and why? |
I tried to merge this to release_90, but I got a test failure. Does this rely on more patches that need merging? Can you try applying it to the release branch in the monorepo and see what needs fixing?
$ ninja check-clangd [7/8] Running the Clangd regression tests llvm-lit: /work/llvm-9/llvm/utils/lit/lit/llvm/config.py:340: note: using clang: /work/llvm-9/build.release/bin/clang FAIL: Clangd Unit Tests :: ./ClangdTests/IgnoreDiags.FromNonWrittenInclude (368 of 573) ******************** TEST 'Clangd Unit Tests :: ./ClangdTests/IgnoreDiags.FromNonWrittenInclude' FAILED ******************** Note: Google Test filter = IgnoreDiags.FromNonWrittenInclude [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from IgnoreDiags [ RUN ] IgnoreDiags.FromNonWrittenInclude /work/llvm-9/llvm/tools/clang/tools/extra/clangd/unittests/DiagnosticsTests.cpp:945: Failure Value of: TU.build().getDiagnostics() Expected: is empty Actual: { [./a.h:0:0-0:4] 'main' must return 'int' }, which has 1 element [ FAILED ] IgnoreDiags.FromNonWrittenInclude (20 ms) [----------] 1 test from IgnoreDiags (20 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (21 ms total) [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] IgnoreDiags.FromNonWrittenInclude 1 FAILED TEST Preamble for file /clangd-test/TestTU.cpp cannot be reused. Attempting to rebuild it. Built preamble of size 201076 for file /clangd-test/TestTU.cpp ******************** Testing Time: 3.92s ******************** Failing Tests (1): Clangd Unit Tests :: ./ClangdTests/IgnoreDiags.FromNonWrittenInclude Expected Passes : 569 Unsupported Tests : 3 Unexpected Failures: 1 FAILED: tools/clang/tools/extra/clangd/test/CMakeFiles/check-clangd
thanks for the information, I suspect that this patch may depend on rL367303 (which is not merged in the release), I will double check.
thanks for the information, I suspect that this patch may depend on rL367303 (which is not merged in the release), I will double check.
Yes, that seems to be it. I've merged that, and then I could merge this one in r368683.
Could you add a comment describing which diagnostic we do not want to see here and why?
I assume it's main should return int, right?