Diagnostic locations were broken when it was result of a macro
expansion. This patch fixes it by using expansion location instead of location
inside macro body.
Details
- Reviewers
hokein - Commits
- rGe841029aef74: [clangd] Fix diagnostic location for macro expansions
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Build result: pass - 60059 tests passed, 0 failed and 729 were skipped.
Log files: console-log.txt, CMakeCache.txt
clang-tools-extra/clangd/Diagnostics.cpp | ||
---|---|---|
121 | should we use getExpansionLoc? getFileLoc returns a spelling location if it comes from a macro argument, but I think it doesn't matter. | |
clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp | ||
944 | this doesn't belong to IgnoreDiags any more, I think, should be DiagsInHeaders, the same to the newly-added test. | |
1012 | could you add one more test case where foo is spelled at macro argument? I believe it was broken as well before this patch. #define X(arg) arg X(foo); |
Build result: pass - 60220 tests passed, 0 failed and 732 were skipped.
Log files: console-log.txt, CMakeCache.txt
clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp | ||
---|---|---|
995 | I'd move this to the end of the file, so that all DiagsInHeaders are grouped together. |
should we use getExpansionLoc? getFileLoc returns a spelling location if it comes from a macro argument, but I think it doesn't matter.