whisperity added inline comments.
================ Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:481 + + assert(TargetIdx.hasValue() && "Matched, but didn't find index?"); + TargetParams[PassedParamOfThisFn].insert( ---------------- aaron.ballman wrote: > I *think* you could run into this assert with K&R C function where there is a > `FunctionDecl` to get back to but the decl claims it has no params because it > has no prototype (while the call expression actually has the arguments). > However, there may be other code that protects us from this case. At face value, I would say the fact that a K&R function //has no params// declared means that the matcher above will not be able to do `forEachArgumentWithParam`, because the argument vector is N long, but the parameter vector is empty. Nevertheless, it won't hurt to add a test case for this though. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78652/new/ https://reviews.llvm.org/D78652 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits