[clang] [clang-tools-extra] clangd: Show argument names for function pointer struct fields (PR #69011)

via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 20 06:35:07 PST 2024


================
@@ -6133,7 +6133,17 @@ ProduceSignatureHelp(Sema &SemaRef, MutableArrayRef<ResultCandidate> Candidates,
 // so that we can recover argument names from it.
 static FunctionProtoTypeLoc GetPrototypeLoc(Expr *Fn) {
   TypeLoc Target;
-  if (const auto *T = Fn->getType().getTypePtr()->getAs<TypedefType>()) {
+
+  if (const auto *ME = dyn_cast<MemberExpr>(Fn)) {
+    const auto *MD = ME->getMemberDecl();
+    if (const auto *FD = dyn_cast<FieldDecl>(MD)) {
+      if (const auto *T = FD->getType().getTypePtr()->getAs<TypedefType>()) {
----------------
Qwinci wrote:

I forgot this PR, it should be fixed now.

https://github.com/llvm/llvm-project/pull/69011


More information about the cfe-commits mailing list