[PATCH] D71403: [clangd] Fix hover crashing on null types

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 12 01:57:58 PST 2019


ilya-biryukov added inline comments.


================
Comment at: clang-tools-extra/clangd/Hover.cpp:251
   QualType T = E->getType();
-  if (T->isFunctionType() || T->isFunctionPointerType() ||
+  if (T.isNull() || T->isFunctionType() || T->isFunctionPointerType() ||
       T->isFunctionReferenceType())
----------------
NIT: Replace `T.isNull()` with `!T`


================
Comment at: clang-tools-extra/clangd/unittests/HoverTests.cpp:517
+        void boom(int name) {
+          new Tmpl<A>([[na^me]]);
+        })cpp",
----------------
Why is the type null here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71403





More information about the cfe-commits mailing list