From c4e95c76197d386452a9b4524a4a5429b32bce72 Mon Sep 17 00:00:00 2001
From: Peter Collingbourne <peter@pcc.me.uk>
Date: Thu, 23 Jun 2016 18:11:19 +0000
Subject: [PATCH] Add a test case for the regression in -Wfor-loop-analysis
 caused by r273548.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273590 91177308-0d34-0410-b5e6-96231b3b80d8
---
 test/SemaCXX/warn-loop-analysis.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/SemaCXX/warn-loop-analysis.cpp b/test/SemaCXX/warn-loop-analysis.cpp
index c666c48fc01..25ec7a7862e 100644
--- a/test/SemaCXX/warn-loop-analysis.cpp
+++ b/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) {}
+}
-- 
GitLab