http://llvm.org/bugs/show_bug.cgi?id=20536
Bug ID: 20536
Summary: Only ignore warnings on macro bodies, not macro
arguments
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
#define assert(x) if(x) return;
bool foo();
void test(bool x, bool y, bool z, unsigned a) {
assert(x || y && z); // needs -Wparentheses warning here
if (x || y && z) {} // warns here
assert(a >= 0); // needs -Wtautological-compare here
if (a >= 0) {} // warns here
}
The two asserts above should generate warnings since the entire expression that
should be warned on is inside the macro argument.
r214672 & r214671 fixed two issues that were not caught by the current Clang
warnings.
--
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