https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90797 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- I think this violates [basic.scope.class] p2 and so is not valid. I'm not positive though.