r273590 - Add a test case for the regression in -Wfor-loop-analysis caused by r273548.
Peter Collingbourne via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 23 11:11:19 PDT 2016
Author: pcc
Date: Thu Jun 23 13:11:19 2016
New Revision: 273590
URL: http://llvm.org/viewvc/llvm-project?rev=273590&view=rev
Log:
Add a test case for the regression in -Wfor-loop-analysis caused by r273548.
Modified:
cfe/trunk/test/SemaCXX/warn-loop-analysis.cpp
Modified: cfe/trunk/test/SemaCXX/warn-loop-analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-loop-analysis.cpp?rev=273590&r1=273589&r2=273590&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-loop-analysis.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-loop-analysis.cpp Thu Jun 23 13:11:19 2016
@@ -260,3 +260,9 @@ void test8() {
i--;
}
}
+
+int f(int);
+void test9() {
+ // Don't warn when variable is defined by the loop condition.
+ for (int i = 0; int x = f(i); ++i) {}
+}
More information about the cfe-commits
mailing list