[PATCH] D59302: [clangd] Surface diagnostics from headers inside main file

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 29 00:55:27 PDT 2019


ilya-biryukov added inline comments.


================
Comment at: clangd/Diagnostics.cpp:115
+  const SourceManager &SM = Info.getSourceManager();
+  std::vector<SourceLocation> IncludeStack;
+  auto GetIncludeLoc = [&SM](SourceLocation SLoc) {
----------------
replace `vector<SourceLocation>` with `SourceLocation` now that we only need one of the locations.


================
Comment at: unittests/clangd/DiagnosticsTests.cpp:748
+              UnorderedElementsAre(
+                  Diag(Main.range(), "Error in include c.h: C++ requires a "
+                                     "type specifier for all declarations")));
----------------
NIT: maybe quote the name of the header for better readability: `error in include 'c.h' ...`?


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D59302





More information about the cfe-commits mailing list