On Fri, 3 Jun 2022, Marek Polacek wrote:

> On Fri, Jun 03, 2022 at 11:16:26AM -0400, Jason Merrill via Gcc-patches wrote:
> > On 6/3/22 11:04, Patrick Palka wrote:
> > > > > @@ -4319,15 +4319,32 @@ maybe_dummy_object (tree type, tree* binfop)
> > > > >      if (binfop)
> > > > >        *binfop = binfo;
> > > > >    -  if (current_class_ref
> > > > > -      /* current_class_ref might not correspond to 
> > > > > current_class_type if
> > > > > -      we're in tsubst_default_argument or a lambda-declarator; in 
> > > > > either
> > > > > -      case, we want to use current_class_ref if it matches CONTEXT.  
> > > > > */
> > > > > -      && (same_type_ignoring_top_level_qualifiers_p
> > > > > -       (TREE_TYPE (current_class_ref), context)))
> > > > > +  /* current_class_ref might not correspond to current_class_type if
> > > > > +     we're in tsubst_default_argument or a lambda-declarator; in 
> > > > > either
> > > > > +     case, we want to use current_class_ref if it matches CONTEXT.  
> > > > > */
> > > > > +  tree ctype = current_class_ref ? TREE_TYPE (current_class_ref) :
> > > > > NULL_TREE;
> > > > > +  if (ctype
> > > > > +      && same_type_ignoring_top_level_qualifiers_p (ctype, context))
> > > > >        decl = current_class_ref;
> > > > >      else
> > > > > -    decl = build_dummy_object (context);
> > > > > +    {
> > > > > +      /* Return a dummy object whose cv-quals are consistent with 
> > > > > (the
> > > > > +      non-lambda) 'this' if available.  */
> > > > > +      if (ctype)
> > > > > +     {
> > > > > +       int quals = 0;
> 
> Sorry to nitpick, but this 0 could be TYPE_UNQUALIFIED.

Good point, fixed.

> 
> Marek
> 
> 

Reply via email to