[cfe-commits] r124668 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaExpr.cpp test/Analysis/self-init.m test/SemaCXX/warn-assignment-condition.cpp
jahanian
fjahanian at apple.com
Tue Feb 1 13:29:40 PST 2011
On Feb 1, 2011, at 11:37 AM, Argyrios Kyrtzidis wrote:
> On Feb 1, 2011, at 10:39 AM, John McCall wrote:
>
>> On Feb 1, 2011, at 10:24 AM, Argyrios Kyrtzidis wrote:
>>> Author: akirtzidis
>>> Date: Tue Feb 1 12:24:22 2011
>>> New Revision: 124668
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=124668&view=rev
>>> Log:
>>> Warn for "if ((a == b))" where the equality expression is needlessly wrapped inside parentheses.
>>> It's highly likely that the user intended an assignment used as condition.
>>
>> Interesting. I'm worried that some people do this idiomatically, but I'm willing to wait and see. Please don't warn unless the LHS of the == is a modifiable l-value, though.
>
> Oops, fixed in r124675, thanks for catching this blunder!
Do you warn for: "if (((a) == b))". It seems that if LHS is inside a paren, user did not have intention of doing an assignment.
- Fariborz
>
> -Argiris
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list