[PATCH] D111318: [clang][clangd] Improve signature help for variadic functions.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 8 05:30:15 PDT 2021


sammccall added a comment.

Thanks, this looks great, just want to check if there are more callsites we can hit while here.



================
Comment at: clang/lib/Sema/SemaOverload.cpp:6460
   // list (8.3.5).
   if (TooManyArguments(NumParams, Args.size(), PartialOverloading) &&
       !Proto->isVariadic()) {
----------------
Hmm, there are something like 6 callers of TooManyArguments.
They all check isVariadic, and probably should all be adjusted in this way (except in once case where PartialOverloading is constant `false`).
This includes one almost-identical caller in this file, for AddMethodCandidate...

It's tempting to say that we should just pass some more args into TooManyArguments and have it do this logic internally. Maybe pass the FunctionType and the FunctionDecl* in, with the latter nullable?
At least this would keep this nice comment in one place.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111318



More information about the cfe-commits mailing list