On Mon, Dec 01, 2025 at 10:42:52PM +0530, Jason Merrill wrote:
> On 12/1/25 8:53 PM, Jakub Jelinek wrote:
> > On Sun, Nov 30, 2025 at 11:00:03PM +0530, Jason Merrill wrote:
> > > > + /* When doing foo.[: bar :], cp_parser_postfix_dot_deref_expression
> > > > wants
> > > > + to see an identifier or a TEMPLATE_ID_EXPR, if we have something
> > > > like
> > > > + s.template [: ^^S::var :]<int> where S::var is a variable
> > > > template. */
> > > > + if (member_access_p)
> > > > + {
> > > > + /* Grab the unresolved expression then. */
> > > > + t = unresolved;
> > > > + if (DECL_P (t))
> > > > + /* We cannot forget what context we came from, so build up
> > > > + a SCOPE_REF. */
> > > > + t = build_qualified_name (/*type=*/NULL_TREE, CP_DECL_CONTEXT
> > > > (t),
> > > > + DECL_NAME (t), /*template_p=*/false);
> > > > + else if (OVL_P (t))
> > > > + t = OVL_NAME (t);
> > >
> > > It seems wrong to throw away the result of our earlier name lookup, can we
> > > instead improve ...dot_deref... to handle these forms as arguments?
> >
> > It is wrong and it affects real-world testcases.
> > I've made some work on it in the last 2 weeks in
> > https://forge.sourceware.org/marek/gcc/pulls/110
> > where the member access splicing now works I think correctly for
> > non-template members and to some extent for template members too,
> > but Marek didn't want to push further changes to his branch except for patch
> > review feedback.
>
> Well, it's patch review feedback now. :)
Fair enough, I'll work on that next.
Marek