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 for c++/91889 - follow-up fix for DR 2352


On Fri, Sep 27, 2019 at 10:08:49PM -0400, Jason Merrill wrote:
> On 9/26/19 9:45 PM, Marek Polacek wrote:
> > Jason, you remarked that adding a ck_qual under the ck_ref_bind might be
> > too much trouble, but it seems it's actually fairly simple.  The comments
> > hopefully explain my thinking.  Is this what you had in mind?
> 
> Yes, I'm glad to hear it was simpler than I worried it would be.
> 
> > +	/* direct_reference_binding might have inserted a ck_qual under
> > +	   this ck_ref_bind for the benefit of conversion sequence ranking.
> > +	   Ignore the conversion; we'll create our own below.  */
> > +	if (next_conversion (convs)->kind == ck_qual)
> > +	  {
> > +	    gcc_assert (same_type_p (TREE_TYPE (expr),
> > +				     next_conversion (convs)->type));
> > +	    STRIP_NOPS (expr);
> 
> Why STRIP_NOPS?

I needed to strip the cast the ck_qual had created so that the call to
cp_build_addr_expr below won't fail with "lvalue required as the operand of &".
Perhaps a comment should explain it.

Marek


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