[PATCH] D70494: [clangd] Fix diagnostic location for macro expansions

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 22 05:01:57 PST 2019


kadircet marked 5 inline comments as done.
kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/Diagnostics.cpp:121
   const SourceManager &SM = Info.getSourceManager();
+  const SourceLocation &DiagLoc = SM.getFileLoc(Info.getLocation());
   SourceLocation IncludeInMainFile;
----------------
hokein wrote:
> should we use getExpansionLoc? getFileLoc returns a spelling location if it comes from a macro argument, but I think it doesn't matter.
right


================
Comment at: clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp:944
 
 TEST(IgnoreDiags, FromNonWrittenSources) {
   Annotations Main(R"cpp(
----------------
hokein wrote:
> this doesn't belong to IgnoreDiags any more, I think, should be `DiagsInHeaders`, the same to the newly-added test.
ah thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70494





More information about the cfe-commits mailing list