http://llvm.org/bugs/show_bug.cgi?id=10703
Summary: no warning for << versus + precedence confusion
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
clang produces no warnings for the following:
int x[4] = // ...
int k = x[0] << 24 + x[1] << 16 + x[2] << 8 + x[3];
This parses as:
int k = x[0] << (24 + x[1]) << (16 + x[2]) << (8 + x[3]);
Such a warning would need to be careful to not fire on:
std::cout << x[0] << 24 + x[1] << 16 + x[2] << 8 + x[3];
--
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