[clang-tools-extra] [clangd] Guard against trivial FunctionProtoTypeLoc when creating inlay hints (PR #143087)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 6 07:33:49 PDT 2025


================
@@ -368,6 +368,14 @@ static FunctionProtoTypeLoc getPrototypeLoc(Expr *Fn) {
   }
 
   if (auto F = Target.getAs<FunctionProtoTypeLoc>()) {
+    // In some edge cases the AST can contain a "trivial" FunctionProtoTypeLoc
----------------
hokein wrote:

nit: We have a duplicated one in ` SemaCodeComplete.cpp`, see the `FIXME` on line 337. I guess the same issue  should happen there as well (signaturehelp?). I see options 1) duplicate the workaround 2) unify these two implementations. Either works for me.   

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


More information about the cfe-commits mailing list