http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48884
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid Status|UNCONFIRMED |NEW Last reconfirmed| |2011.05.05 12:35:32 Ever Confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-05-05 12:35:32 UTC --- confirmed if Y::f is not a template then access checking succeeds here's a C++03 version, which fails in the same way: class X { int value ; friend class Y ; } ; template <int> struct Int { }; class Y { public : template < typename T > static Int<sizeof(T::value)> f(T t) { return Int<sizeof(t.value)>(); } } ; int main() { X x ; Y::f(x) ; // gcc issues error }