[PATCH] D81351: [clangd] Parse std::make_unique, and emit template diagnostics at expansion.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 01:36:37 PDT 2020


hokein accepted this revision.
hokein added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/Diagnostics.cpp:692
+    LastDiagWasOriginalError =
+        Info.getDiags()->getDiagnosticIDs()->isDefaultMappingAsError(
+            Info.getID());
----------------
nit: we have a same method call on Line 568, I think we can use a separate local variable to store the result at the beginning of this function.


================
Comment at: clang-tools-extra/clangd/Diagnostics.cpp:738
+      vlog("Dropped diagnostic: {0}: {1}", LastDiag->File, LastDiag->Message);
+    LastDiag.reset();
+  });
----------------
shall we also reset `LastDiagLoc`?


================
Comment at: clang-tools-extra/clangd/Diagnostics.h:151
+  bool LastDiagWasOriginalError = false;
+  llvm::DenseSet<std::pair<unsigned, unsigned>> IncludedErrorLocations;
   bool LastPrimaryDiagnosticWasSuppressed = false;
----------------
nit: document what do `pair.first` and  `pair.second` represent


================
Comment at: clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp:282
+    template <typename T>
+    struct Derived : [[T]] {};"
+  )cpp");
----------------
nit: an extra `;` at the end.


================
Comment at: clang/include/clang/Frontend/PrecompiledPreamble.h:287
   virtual CommentHandler *getCommentHandler();
+
+  virtual bool shouldSkipFunctionBody(Decl *D);
----------------
nit: documentation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81351





More information about the cfe-commits mailing list