summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-06-23 18:11:19 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-06-23 18:11:19 +0000
commitae72fa2f97fb18f84f398bd99006c25d0614f39a (patch)
treeb7bfbd154b3cfba3501c5822314af6db7252b8d6
parentb77ebd749af6171a565c19139849fc7d8d4209e4 (diff)
downloadbcm5719-llvm-ae72fa2f97fb18f84f398bd99006c25d0614f39a.tar.gz
bcm5719-llvm-ae72fa2f97fb18f84f398bd99006c25d0614f39a.zip
Add a test case for the regression in -Wfor-loop-analysis caused by r273548.
llvm-svn: 273590
-rw-r--r--clang/test/SemaCXX/warn-loop-analysis.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-loop-analysis.cpp b/clang/test/SemaCXX/warn-loop-analysis.cpp
index c666c48fc01..25ec7a7862e 100644
--- a/clang/test/SemaCXX/warn-loop-analysis.cpp
+++ b/clang/test/SemaCXX/warn-loop-analysis.cpp
@@ -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) {}
+}
OpenPOWER on IntegriCloud