Open Quuxplusone opened 9 years ago
This check doesn't produce fixit hints. I'm not sure whether it can produce fixits for all cases safely. It would need to analyze the implementation of the assignment operator and in some cases its usages.
I also expect this check to fire not extremely frequently, so a fix wouldn't save much time, I guess. But I also may be wrong ;)
What Alex said. The cost of writing the fixit code was not worth it, at least
for us.
For the 'const T&' case we might be able to do it, since there is already a
return statement. For other return types (void, int, etc) it would be really
hard.
(In reply to comment #2)
> What Alex said. The cost of writing the fixit code was not worth it, at
> least for us.
> For the 'const T&' case we might be able to do it, since there is already a
> return statement. For other return types (void, int, etc) it would be really
> hard.
There is 156 placed in LLDB code majority of which return const Type&. This
looks worth to try to automate.
Automation may make sense in other code bases.
I run trunk Clang-tidy against trunk LLDB code which contain a lot of assign operators which return const Type& instead of Type&, but Clang-tidy was not able to fix such code.