r177698 - Warn about attempts to reinterpret_cast between two types that are

Alexander Zinenko ftynse at gmail.com
Tue Mar 26 09:02:55 PDT 2013


Hello Richard, John!

I'm sorry I overlooked the possibility of invalid declarations. Please find
the fix and extra tests attached.

--
Alex


On 26 March 2013 02:47, Richard Smith <richard at metafoo.co.uk> wrote:

> Hi John,
>
> We have a crash-on-invalid here. Testcase:
>
> struct A;
> struct B { A a; };
> struct C : B {} c;
> B *p = reinterpret_cast<B*>(&c);
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130326/c4a35429/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 13824fix.patch
Type: application/octet-stream
Size: 4311 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130326/c4a35429/attachment.obj>


More information about the cfe-commits mailing list