http://llvm.org/bugs/show_bug.cgi?id=7815
Summary: 'x' is always zero in this context should not apply to
LHS of assignment
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
This program emits an unexpected warning:
int f();
void test() {
if (int x = f()) {
x = 1; // ok
} else {
x = 2; // warning: 'x' is always zero in this context
}
}
There's no reason to warn about the left-hand side of the expression being
zero, its value isn't really relevant.
--
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