[PATCH] D82701: [clangd][Hover] Dont crash on null types

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 28 23:57:31 PDT 2020


hokein accepted this revision.
hokein added a comment.
This revision is now accepted and ready to land.

Thanks, I was going to prepare a patch this morning, then realized this one.



================
Comment at: clang-tools-extra/clangd/Hover.cpp:302
       P.Type = printType(PVD->getType(), Policy);
     } else {
       std::string Param;
----------------
nit: now we can remove this if-else branch.


================
Comment at: clang-tools-extra/clangd/unittests/HoverTests.cpp:716
+          void foo() {
+            M(auto [^[[x]]], bar()); /*error-ok*/
+          }
----------------
I think `auto [x, y] = 1` should be enough to reproduce the crash.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82701





More information about the cfe-commits mailing list