================
@@ -77,6 +82,33 @@ inline const ParmVarDecl *getFunctionOrMethodParam(const
Decl *D,
return MD->getParamDecl(Idx);
if (const auto *BD = dyn_cast<BlockDecl>(D))
return BD->getParamDecl(Idx);
+
+ // Handle declarations that do not directly own parameters but have an
----------------
mimischly7 wrote:
I tried to mirror the cases handled by `Decl::getFunctionType()` from
`clang/lib/AST/DeclBase.cpp`. My thinking if there is some `Decl` that is not
handled by `Decl::getFunctionType()`, then it should not be expected that it is
handled by `getFunctionOrMethodParam()`, which tends to be below
`Decl::getFunctionType()` in the chain. For alloc_align attribute,
`Decl::getFunctionType()` is called on the Decl first (through
`getFunctionOrMethodResultType`) and if that returns nullptr then the call to
`getFunctionOrMethodParam()` is not not even reached.
https://github.com/llvm/llvm-project/pull/210871
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits