[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

Argyrios Kyrtzidis kyrtzidis at apple.com
Tue Feb 1 11:37:32 PST 2011

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!


More information about the cfe-commits mailing list