From ae72fa2f97fb18f84f398bd99006c25d0614f39a Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 23 Jun 2016 18:11:19 +0000 Subject: Add a test case for the regression in -Wfor-loop-analysis caused by r273548. llvm-svn: 273590 --- clang/test/SemaCXX/warn-loop-analysis.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/test/SemaCXX/warn-loop-analysis.cpp') 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) {} +} -- cgit v1.2.3