This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: 14035
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: mark at codesourcery dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 20 Oct 2004 12:17:26 +0100
- Subject: Re: C++ PATCH: 14035
- Organization: Codesourcery LLC
- References: <200410192329.i9JNTEcX022990@sirius.codesourcery.com>
Mark Mitchell wrote:
This patch fixes PR c++/14035. This PR was opened because of a cast
where we generated wrong-code for a C-style cast. In particular, we
generated a copy constructor call instead of a derived-to-base
conversion.
The underlying problem was that we were not handling C-style casts as
one of const_cast, static_cast, or reinterpret_cast as required by
the standard. (There are a few extra bits, but that's the basic
idea.) So, I fixed that.
This patch appears to be causing regressions with gth_default.
/home/nathan/egcs/head/i686-pc-linux-gnu/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu/bits/gthr-default.h: In function `int __gthread_active_p()':
/home/nathan/egcs/head/i686-pc-linux-gnu/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu/bits/gthr-default.h:108: error: ISO C++ forbids casting between pointer-to-function and pointer-to-object
Whilst that is correct, I suspect it'll bite a lot of users.
I think we should implement something like the drafting resolution
of DR 195. http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#195
It doesn't seem a good plan to get stricter now, when a more relaxed
attitidue is coming our way!
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk