[PATCH] D97577: [clang-tidy] performance-for-range-copy: Don't trigger on implicit type conversions.
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 1 23:19:05 PST 2021
lebedev.ri added a comment.
In D97577#2596458 <https://reviews.llvm.org/D97577#2596458>, @hokein wrote:
> In D97577#2592827 <https://reviews.llvm.org/D97577#2592827>, @flx wrote:
>
>> In D97577#2592093 <https://reviews.llvm.org/D97577#2592093>, @lebedev.ri wrote:
>>
>>> It is best not to change existing tests, but add new ones.
>>
>> Could elaborate on this, Roman?
>>
>> In this case the tests use special auto convertible types with the intention to test that the check doesn't trigger because the loop variable needs to be constructed. But the reason they don't trigger is that the loop variable erroneously is already a reference type.
>>
>> If we keep the tests as is we should rename the test functions and use different types or document that the real reason they don't trigger is that they already are const reference types, but we already have a test for that as well.
>
> The explanation sounds plausible, thanks.
Yep, no further comments from me.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97577/new/
https://reviews.llvm.org/D97577
More information about the cfe-commits
mailing list