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: PR 27177


Mark Mitchell wrote:
> This patch fixes PR c++/27177, a tricky ICE-on-valid regression.  The
> cast, performed within a sizeof in the initializer for a static data
> member, would be a static_cast -- except that the derived class is not
> yet complete.  Therefore, it's a reinterpret_cast.  We were trying to
> do the derived-to-base conversion, and getting an ICE since the base
> class offset isn't yet known.
> 
> (This is another example of the weird problems that are caused by the
> C++ standard permitting arbitrary expressions inside sizeof; the stuff
> inside sizeof is generally not valid in an
> integral-constant-expression, but sizeof is.)
> 
> Tested on x86_64-unknown-linux-gnu, applied on the mainline and on the
> 4.1 branch.

This patch appears to cause a further regression, as per my comment on
the PR: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27177

(I wasn't sure whether this should be added to that PR, since it's still
open, or filed as a new PR.)

Zak.


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