<div dir="ltr">On Mon, Jul 29, 2013 at 7:00 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The upcast/downcast tests might want to be codegen tests to ensure<br>
that, not only do we not fail to compile it - but we compile it<br>
correctly (not emitting any calls to RTTI stuff, etc).<br></blockquote><div><br></div><div>Thanks David !</div><div><br></div><div>The test is now a codegen test, checking there is no call to __dynamic_cast --- and no diagnostics.</div>
<div> </div><div>Cheers,</div><div>--</div><div>Arnaud</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
On Mon, Jul 29, 2013 at 9:48 AM, Arnaud A. de Grandmaison<br>
<<a href="mailto:arnaud.adegm@gmail.com">arnaud.adegm@gmail.com</a>> wrote:<br>
> With the patch :)<br>
><br>
> On 07/29/2013 06:47 PM, Arnaud A. de Grandmaison wrote:<br>
>> On 07/29/2013 06:17 PM, Jean-Daniel Dupas wrote:<br>
>>> Le 29 juil. 2013 à 17:52, Arnaud A. de Grandmaison <<a href="mailto:arnaud.adegm@gmail.com">arnaud.adegm@gmail.com</a>> a écrit :<br>
>>><br>
>>>> Clang emits an error when typeid is used with -fno-rtti, but does not<br>
>>>> perform a similar check for dynamic_cast.<br>
>>>><br>
>>>> The attached patch implements the check.<br>
>>>><br>
>>>> I have done it late in 'CastOperation::CheckDynamicCast' , as some<br>
>>>> dynamic_cast can be resolved statically, and will thus require no<br>
>>>> support from the runtime, but we may also want to be more paranoïd.<br>
>>>><br>
>>>> Any thoughts ?<br>
>>> If we want to support dynamic_cast without rtti when possible (as you do in your patch), you may add such case in the test to make sure clang accepts it.<br>
>> Good point. I added a test for the 2 cases we accept (upcast, and cast<br>
>> to same type).<br>
>><br>
>>> -- Jean-Daniel<br>
>>><br>
>>><br>
>>><br>
>>><br>
>><br>
><br>
><br>
> --<br>
> Arnaud A. de Grandmaison<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
</blockquote></div><br></div></div>