Closed
Description
Bugzilla Link | 9056 |
Resolution | FIXED |
Resolved on | Jan 26, 2011 20:02 |
Version | trunk |
OS | All |
Attachments | Test case |
Reporter | LLVM Bugzilla Contributor |
CC | @tkremenek,@nico |
Extended Description
The recent merge of -Wuninitialized-experimental with -Wuninitialized introduces a very annoying false positive.
When using the "for in" objc syntax, clang emits a warning.
------------ foreach.m
void test() {
id collection = 0;
for (id obj in collection) {
if (0 == obj)
break;
}
}
clang -fsyntax-only -Wuninitialized foreach.m
foreach.m:4:8: warning: use of uninitialized variable 'obj' [-Wuninitialized]
for (id obj in collection) {
^~~~~~
foreach.m:5:11: note: variable 'obj' is possibly uninitialized when used here
if (0 == obj)
^~~
foreach.m:4:14: note: add initialization to silence this warning
for (id obj in collection) {
^
= 0
1 warning generated.