http://llvm.org/bugs/show_bug.cgi?id=9625
Summary: False positive with -Wuninitialized in trivially dead
code
Product: clang
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
I thought we were able to prune trivially dead code:
% cat x.cc
void test() {
if (false) {
int x;
(void)static_cast<float>(x);
}
}
% ./bin/clang -fsyntax-only -Wuninitialized x.cc
x.cc:4:30: warning: variable 'x' is possibly uninitialized when used here
[-Wuninitialized]
(void)static_cast<float>(x);
^
x.cc:3:5: note: variable 'x' is declared here
int x;
^
x.cc:3:10: note: add initialization to silence this warning
int x;
^
= 0
1 warning generated.
(the original code is doing casts to check if pointers are convertible, but
same difference)
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs