[PATCH] D70317: [clangd] More sensible output for constructors/destructors in hover.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 18 01:29:50 PST 2019


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/XRefs.cpp:598
+    // Constructor's "return type" is the class type.
+    HI.ReturnType = declaredType(CCD->getParent()).getAsString(Policy);
+    // Don't provide any type for the constructor itself.
----------------
this looks reasonable though I'd prefer not setting the return type for ctor/dtor. If we decide to go down this path, we'd better make other "returnType" places (`Symbol::ReturnType`, CodeCompletion) align with this.


================
Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:914
           template<typename> struct X;
           template<typename T> struct X<T*>{ [[^X]](); };
           )cpp",
----------------
nit: add a test case for destructor?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70317





More information about the cfe-commits mailing list