https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77368 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- There are several bugs related to access checking in templates, this is a dup of one of them.