[cfe-commits] r90867 - in /cfe/trunk: lib/Sema/SemaCXXCast.cpp test/SemaObjCXX/cstyle-cast.mm

Fariborz Jahanian fjahanian at apple.com
Tue Dec 8 15:12:09 PST 2009


On Dec 8, 2009, at 1:02 PM, Douglas Gregor wrote:

>
>>
>
> I think this is too permissive. The C path does a bit of checking  
> for scalar types in Sema::CheckCastTypes, which makes code like the  
> following ill-formed:
>
>  struct X { X(); };
>
>  void f(X x) {
>    (id)x;
>  }
>
> GCC rejects this code, Clang accepts it.
>
> Also, before exiting this function we need to set CastKind to an  
> appropriate value, to describe what kind of cast we're doing. It  
> might involve adding new CastKinds to properly capture Objective-C  
> casts.

This is done in http://llvm.org/viewvc/llvm-project?view=rev&revision=90895

But I don't think we have heard last of objective-c type issues in  
objective-c++ mode (which they pretty much follow
c-rules per gcc's implementation).

- Fariborz

>
>
> 	- Doug




More information about the cfe-commits mailing list