c++: Adjust synthetic template parm creation
authorNathan Sidwell <nathan@acm.org>
Tue, 25 Oct 2022 13:39:00 +0000 (09:39 -0400)
committerNathan Sidwell <nathan@acm.org>
Tue, 25 Oct 2022 19:16:22 +0000 (15:16 -0400)
commit43e654afeba484d75fbee080262a038c1da00ad5
treeba3b9cc0bc14981159ac43691e5dd0fdd293e103
parentfe1e1ae0c84d3f52f62509d164bbb117c29d9675
c++: Adjust synthetic template parm creation

We intend to mark synthetic template parameters (coming from use of auto
parms), as DECL_VIRTUAL_P.  The API of process_template_parm is
awkwardly confusing, and we were marking the previous template parm
(unless this was the first parm).  process_template_parm returns the list
of parms, when most (all?) users really want the newly-added final node.
That's a bigger change, so let's not do it right now.  With this, we
correctly mark such synthetic parms DECL_VIRTUAL_P.

gcc/cp/
* parser.cc (synthesize_implicit_template_parm): Fix thinko about
mark the new parm DECL_VIRTUAL_P.  Avoid unneccessary tree_last call.
gcc/cp/parser.cc