aaron.ballman added a comment. In https://reviews.llvm.org/D24349#537595, @xazax.hun wrote:
> In https://reviews.llvm.org/D24349#537594, @omtcyfz wrote: > > > In https://reviews.llvm.org/D24349#537589, @Eugene.Zelenko wrote: > > > > > If size() and empty() change object's state, it may be not equivalent > > > replacement. > > > > > > True. But my point is that they are not required to do that if they're just > > not marked `const`. > > > I agree with Eugene. But I think a good consensus could be to warn on the > non-const case but do not do the rewrite. What do you think? I think that's reasonable, depending on whether we find false positives with the warning as well (I have a slight concern about `size()` and `empty()` being unrelated operations on a non-container class that someone writes). Repository: rL LLVM https://reviews.llvm.org/D24349 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits