https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86823
Alexandre Oliva <aoliva at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |aoliva at gcc dot gnu.org --- Comment #5 from Alexandre Oliva <aoliva at gcc dot gnu.org> --- Created attachment 45028 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45028&action=edit candidate patch Simply leaving the firewall early through lexical scoping didn't cut it, so I'm trying this: collapsing the firewall's two access check layers with the one layer we explicitly create to hold the template id access check, save the collapsed cobination, then push two empty layers back so that the firewall finds the layers it wants to pop. I also noticed we (that function) wanted to pop our own deferred access checks to the parent layer on the stack, but it wasn't: it was just popping it to the enclosing firewall layer, that would also be dropped on the floor. So I added one more pop to parent, after saving the collapsed checks, that does what we want, and a corresponding push that it will cancel out. We might want to leave the firewall scope before the final pop to parent instead, though.