On Apr 22, 2011, at 4:57 PM, Argyrios Kyrtzidis wrote:
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaCXXCast.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaCXXCast.cpp Fri Apr 22 18:57:57 2011
> @@ -1327,9 +1327,18 @@
> // same effect as the conversion *reinterpret_cast<T*>(&x) with the
> // built-in & and * operators.
>
> - // Cannot get address of a bitfield.
> - if (SrcExpr.get()->getObjectKind() == OK_BitField) {
> - msg = diag::err_bad_reinterpret_cast_bitfield;
> + const char *inappropriate = 0;
> + switch (SrcExpr.get()->getObjectKind()) {
> + default: break;
> + case OK_BitField: inappropriate = "bit-field"; break;
> + case OK_VectorComponent: inappropriate = "vector element"; break;
> + case OK_ObjCProperty: inappropriate = "property expression"; break;
> + }
Please do an exhaustive switch, especially since there's only one other case. :)
John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits