https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58972 --- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- Seems to be fixed on trunk, probably by Ville's fix for protected members.