nridge added inline comments.
================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:538
+ for (size_t I = 0; I < FD->getNumParams(); ++I) {
+ if (const auto *Param = FD->getParamDecl(I)) {
+ auto T = Param->getType();
----------------
tom-anders wrote:
> sammccall wrote:
> > I feel like you'd be better off using the FunctionProtoType and iterating
> > over argument types, rather than the argument declarations on a particular
> > declaration of the function.
> >
> > e.g. this code is legal in C:
> > ```
> > int x(); // i suspect this is the canonical decl
> > int x(int); // but this one provides the type
> > ```
> > We don't have references in C of course!, but maybe similar issues
> > lurking...
> I'm not really sure how to get from the CallExpr to the FunctionProtoType,
> can you give me a hint?
I think `FD->getType()->getAs<FunctionProtoType>()` should do it
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108320/new/
https://reviews.llvm.org/D108320
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits