https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20397
--- Comment #17 from Jonathan Wakely <redi at gcc dot gnu.org> --- FWIW for the original testcase G++ now says: a.cc:9:8: error: ‘class A A::A’ is inaccessible within this context int c(A *a) { return 7; } ^ a.cc:1:9: note: declared here class A { ^ Which is ... different, I'll say that for it. I'm not sure if "A::A" is meant to refer to the injected-class-name, but if it is then it's not terribly clear unless you already know what that means and why it happens.