[PATCH] D71503: New warning on for-loops that never run because condition is false on the first iteration

2019-12-16 Thread Richard Trieu via Phabricator via cfe-commits
rtrieu updated this revision to Diff 234180. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71503/new/ https://reviews.llvm.org/D71503 Files: clang/include/clang/AST/Expr.h clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/AST/ExprConstant.cpp clang/lib/Sema/SemaStmt.cpp

[PATCH] D71503: New warning on for-loops that never run because condition is false on the first iteration

2019-12-16 Thread Richard Trieu via Phabricator via cfe-commits
rtrieu added a comment. In D71503#1784697 , @lebedev.ri wrote: > Thank you for working on this! > This seems to be missing tests. My bad, still getting used to git. Updated with a test now. CHANGES SINCE LAST ACTION

[PATCH] D71503: New warning on for-loops that never run because condition is false on the first iteration

2019-12-14 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Thank you for working on this! This seems to be missing tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71503/new/ https://reviews.llvm.org/D71503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D71503: New warning on for-loops that never run because condition is false on the first iteration

2019-12-13 Thread Richard Trieu via Phabricator via cfe-commits
rtrieu created this revision. This is a proposed warning to be added to -Wfor-loop-analysis, which is part of -Wall. This warning will catch instances where the condition will be false on the first iteration and the loop body will never be run. The warning will be emitted when: 1. The