http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
Daniel Krügler <daniel.kruegler at googlemail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | --- Comment #8 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-07-23 21:01:09 UTC --- I agree that the actual test examples work now, but I also found that only *slight* variations of the call context of the test expression "sizeof(f<C>(0))" again lead to access errors. The following variants demonstrate this: //--- class C { typedef int type; // Line 2 }; template<class T, class = typename T::type> auto f(int) -> char; template<class> auto f(...) -> char (&)[2]; static_assert(sizeof(f<C>(0)) == 2, ""); // OK typedef int test[sizeof(f<C>(0)) == 2 ? 1 : -1]; // Error template<int> struct I {}; I<sizeof(f<C>(0))> i; // Error enum E { e1 = sizeof(f<C>(0)) }; // Error //--- "13|error: size of array 'test' is negative| 2|error: 'typedef int C::type' is private| 5|error: within this context| 2|error: 'typedef int C::type' is private| 18|error: within this context| 2|error: 'typedef int C::type' is private| 5|error: within this context| " Jason suggested to reopen the issue, so I did.