C++ PATCH: fix PR 10891
Gabriel Dos Reis
gdr@cs.tamu.edu
Sun Jan 22 19:38:00 GMT 2006
Nathan Sidwell <nathan@codesourcery.com> writes:
| 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.
I believe you. I saw references to PR in other parts of the compiler,
as witnesses of bugs we used to have, not as a susbitute for
documentation. That was the intent here.
| the comment should be self contained possibly with reference to the relevent
| section of the appropriate standard.
I'm all for self-contained comments and citation to appropriate part
of the standard. Removing the reference to the PR does not make the
comment less self-contained. It serves here as a witness of our past
failure.
| In this case it's pretty obvious that dynamic_cast requires rtti :)
Fully agreed. :-)
-- Gaby
More information about the Gcc-patches
mailing list