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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to