[cfe-users] Extra argument when calling object of class type
Brennan Vincent via cfe-users
cfe-users at lists.llvm.org
Wed Nov 28 10:07:00 PST 2018
I have noticed that there is an extra argument in `CXXOperatorCallExpr`
corresponding to the object itself. For example:
In this case, the corresponding `CXXOperatorCallExpr` will have
four arguments: `s`, `1`, `"asdf"`, and `2`.
However, when getting the declaration of the callee
(e.g. in `expr->getDirectCallee()`), it doesn't have a corresponding
extra parameter (in this example, it would have three parameters).
This makes writing linters that deal with call expressions a bit annoying,
since you have to special-case the "call to object of class type" case and
skip the first argument when iterating over call arguments and
function decl parameters in parallel.
Is this intended? If so, is there some API that will just return the three
actual call arguments (`1`, `"asdf"`, and `2`) ?
Thanks for any advice.
More information about the cfe-users