[PATCH] Add -Wrange-loop-analysis to warn when a range-based for-loop is creating a copy.

Richard Trieu rtrieu at google.com
Fri Feb 27 14:54:29 PST 2015


In http://reviews.llvm.org/D4169#131597, @dblaikie wrote:

> In http://reviews.llvm.org/D4169#68650, @dblaikie wrote:
>
> > You could probably be a bit narrower than POD types - probably just
> >  types with trivial copy constructors. But for now "all POD types"
> >  shouldn't have any false positives, only false negatives - so perhaps
> >  leave it that way with a FIXME Describing a narrower check for small
> >  types (small to be defined/discovered) with trivial copy construction.
>
>
> Have you addressed these suggestions?
>
> I don't recall where this was all left, exactly.


Currently, all POD types for copies are ignored.  There is a comment to only ignore types with trivial constructors and to figure out a proper size for small in a future revision.


http://reviews.llvm.org/D4169

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list