================ @@ -234,6 +239,22 @@ void positiveOnlyAccessedFieldAsConst() { } } +void positiveOnlyAccessedFieldAsConstBinding() { + for (auto [X, Y] : View<Iterator<Point>>()) { + // CHECK-MESSAGES: [[@LINE-1]]:13: warning: loop variable is copied but + // CHECK-FIXES: for (const auto& [X, Y] : View<Iterator<Point>>()) { + use(X); + use(Y); + } +} + +void negativeOnlyAccessedFieldAsConstBinding() { ---------------- legrosbuffle wrote:
Done. https://github.com/llvm/llvm-project/pull/77105 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits