diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-06-23 18:11:19 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-06-23 18:11:19 +0000 |
commit | ae72fa2f97fb18f84f398bd99006c25d0614f39a (patch) | |
tree | b7bfbd154b3cfba3501c5822314af6db7252b8d6 /clang/test/SemaCXX/warn-loop-analysis.cpp | |
parent | b77ebd749af6171a565c19139849fc7d8d4209e4 (diff) | |
download | bcm5719-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
Diffstat (limited to 'clang/test/SemaCXX/warn-loop-analysis.cpp')
-rw-r--r-- | clang/test/SemaCXX/warn-loop-analysis.cpp | 6 |
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) {} +} |