[PATCH] D73007: [Sema] Avoid Wrange-loop-analysis false positives

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 24 13:59:20 PST 2020


aaronpuchert added a comment.

Here is a proposal: we add two children to `-Wrange-loop-analysis`.

- `-Wrange-loop-construct` warns about possibly unintended constructor calls. This might be in `-Wall`. It contains
  - `warn_for_range_copy`: loop variable A of type B creates a copy from type C
  - `warn_for_range_const_reference_copy`: loop variable A  is initialized with a value of a different type resulting in a copy
- `-Wrange-loop-bind-ref[erence]` warns about misleading use of reference types. This might **not** be in `-Wall`. It contains
  - `warn_for_range_variable_always_copy`: loop variable A is always a copy because the range of type B does not return a reference


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73007/new/

https://reviews.llvm.org/D73007





More information about the cfe-commits mailing list