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: [PATCH] [PR c++/85437] accept static_casted ptrmem in constexpr


On Fri, Apr 20, 2018, 8:28 AM Nathan Sidwell <nathan@acm.org> wrote:

> On 04/18/2018 01:07 AM, Jason Merrill wrote:
> > I wonder if it would work to use CONVERT_EXPR for reinterpret_cast.
>
> That's kind of the wrong way round, isn't it?  NOP_EXPRs are for things
> that don't generate code, which a reinterpret_cast is.  static_cast adds
> a constant, which is only zero for conversions through the primary base
> (or suitably placed empty base).  CONVERT_EXPR would seem more natural
> there?
>

Any time we need an actual adjustment, there will be a PLUS_EXPR. The issue
is somehow distinguishing between a reinterpret_cast and one of the many
other sources of NOP_EXPR.

I'm not really clear on what the difference between NOP and CONVERT is
supposed to be, anyway...

Jason


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