[cfe-commits] r59460 - in /cfe/trunk: include/clang/AST/Expr.h include/clang/Basic/DiagnosticKinds.def lib/AST/Expr.cpp lib/Sema/SemaExpr.cpp test/Sema/block-misc.c test/Sema/exprs.c

Chris Lattner clattner at apple.com
Mon Nov 17 13:27:14 PST 2008


On Nov 17, 2008, at 12:55 PM, Fariborz Jahanian wrote:

> We used to need this for objc'gc; as in:
>
> % cat test.m
> id p;
>
> int main()
> {
> 	(__strong id)p = 0;
> }
>
> But, having said that, I recently introduced warning for this kind of
> lvalue-casts in gcc:
>
> % mygccpw -fobjc-gc -c test.m
> test.m: In function 'main':
> test.m:5: warning: target of assignment not really an lvalue; this
> will be a hard error in the future
>
> And I have not heard of any project failures. So, it should be OK for
> clang.

Yep, we decided to warn strongly about this in GCC and reject it in  
clang.  Thanks Fariborz,

-Chris




More information about the cfe-commits mailing list