[cfe-dev] GCC-specific, Clang-specific and ObjC-specific casts in C++

Sebastian Redl sebastian.redl at getdesigned.at
Sat Jul 25 09:04:32 PDT 2009


Hi,

I just committed a patch that does correct validation of C-style casts 
for C++. However, it is only correct as far as the standard is 
concerned. Clang does more. To implement this, however, I need information.

1) Do we want to support GCC's cast-to-union in C++? I think not.
2) Should casts to ExtVector types be implicit, static_castable, or only 
reinterpret_castable? Are there formalized semantics, or should I just 
go by the CheckExtVectorCast code?
3) Same for Vector types.
4) Are there formalized Objective-C semantics? Which casts are allowed, 
which are disallowed? Which are implicit, and which, in Objective-C++, 
should be allowed by static_cast and reinterpret_cast respectively?
5) Did I forget anything?

Sebastian



More information about the cfe-dev mailing list