This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH: 14035


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]