[LLVMbugs] [Bug 12285] New: -Widiomatic-parentheses does not work in all cases [objc]
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Mar 16 14:06:07 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=12285
Bug #: 12285
Summary: -Widiomatic-parentheses does not work in all cases
[objc]
Product: clang
Version: 3.0
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: alcosholik at gmail.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Consider the following piece of code in Objective-C:
NSUInteger uid = 10;
if (uid = 11) {
// ...
}
With -Widiomatic-parentheses it gives me the warning "Using the result of an
assignment as a condition without parentheses" (as expected).
However, in the following case no warning is emitted:
if (self.uid = 100) {
// ...
}
The type of 'uid', numbers and variable names can be arbitrary. It's 'self'
that inhibits the warning in some unexpected way.
--
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.
More information about the llvm-bugs
mailing list