-
Notifications
You must be signed in to change notification settings - Fork 13.5k
-Wuninitialized false positive with foreach objc construct. #9428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
bugzilla
Issues migrated from bugzilla
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Comments
cloned to rdar://problem/8921260 |
*** Bug llvm/llvm-bugzilla-archive#9064 has been marked as a duplicate of this bug. *** |
Fixed: r124347 |
mentioned in issue llvm/llvm-bugzilla-archive#9064 |
kateinoigakukun
pushed a commit
to kateinoigakukun/llvm-project
that referenced
this issue
Oct 24, 2024
…e-path-space-fix [lldb] Support swiftlang tests with nested make invocations on Windows
weliveindetail
added a commit
to weliveindetail/llvm-project
that referenced
this issue
Nov 5, 2024
weliveindetail
added a commit
to weliveindetail/llvm-project
that referenced
this issue
Nov 6, 2024
weliveindetail
added a commit
to weliveindetail/llvm-project
that referenced
this issue
Nov 27, 2024
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bugzilla
Issues migrated from bugzilla
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
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.
The text was updated successfully, but these errors were encountered: