<div dir="ltr">hard to say if it's more readable without seeing it - if you could attach a patch, if it's easy enough/you worked it up before, might be worth comparing/contrasting<div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 13, 2017 at 12:28 AM Dean Michael Berris via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dberris added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D34052#778670" rel="noreferrer" target="_blank">https://reviews.llvm.org/D34052#778670</a>, @dblaikie wrote:<br>
<br>
> I take it there's already handling for these attributes on non-member functions?<br>
<br>
<br>
Yes, we're just extending it to also apply to the case where it doesn't support this one case where we actually do need the implicit this argument<br>
<br>
> There's probably a reason this code can't be wherever that code is & subtract one from the index? (reducing code duplication by having all the error handling, etc, in one place/once)<br>
<br>
I tried doing it for the `checkFunctionOrMethodNumParams` function, but it ended up being much more complicated. :(<br>
<br>
The choice is between adding a bool argument (e.g. AllowImplicitThis) in `checkFunctionOrMethodParameterIndex(...)` that's default to always true (to preserve existing behaviour) but the checks and implementation of that template has a number of assumptions as to whether the index is valid for member functions.<br>
<br>
I can change this so that the logic is contained in `checkFunctionOrMethodParameterIndex(...)` if that's more readable?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D34052" rel="noreferrer" target="_blank">https://reviews.llvm.org/D34052</a><br>
<br>
<br>
<br>
</blockquote></div>