C++ PATCH: fix PR 10891

Nathan Sidwell nathan@codesourcery.com
Sun Jan 22 17:52:00 GMT 2006


Gabriel Dos Reis wrote:
> The issue with this PR is that we were accepting codes using
> dynamic_cast while they specific -fno-rtti at the same time.  We then
> produce object codes that crash at runtime.  If -fno-rtti, one can't
> use dynamic_cast.  This patch makes us report the diagnostic at
> compile-time. 

> +   /* Use of dynamic_cast when -fno-rtti is a disaster waiting to happen.
> +      See PR C++/10891.  Reject.  */

We don't usually refer to PR's in the compiler itself.  the comment should be 
self contained possibly with reference to the relevent section of the 
appropriate standard.  In this case it's pretty obvious that dynamic_cast 
requires rtti :)

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk



More information about the Gcc-patches mailing list