https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62255
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2014-09-06 Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> --- And one rejected by all of GCC, Clang and EDG (but also accepted by 4.7): template <typename T> struct Test { template<typename X> static int check(typename X::Type*); template<typename> static char check(...); static const int value = sizeof(check<T>(0)); }; template <int> struct Sink { }; template <typename T> class Derived : Sink<Test<Derived<T> >::value> {}; Sink<Test<Derived<int> >::value> s; If we somehow cause Derived<int> to be instantiated before the last line, such as by declaring a Derived<int> variable, everything is fine. We only run into trouble because it hasn't been. r197613 caused this to start breaking because before that change we had briefly been instantiating classes in more situations, but that caused its own problems. It's not clear to me that this needs to be ill-formed; the value is not dependent on itself, it's just an accident of instantiation context. We could decide to just handle this. I think I'll make that change and also bring it up with the committee.