------- Comment #3 from dushistov at mail dot ru 2010-03-08 20:18 ------- (In reply to comment #1) > compiles without problems using 4.4.3 and 4.5.0 > > if this only fails with GCC 4.2 it's unlikely to get fixed >
There is something strange here. I have report that with little different example, gcc 4.4.3 failed. Here is it, and bellow exact gcc version. ------------------------------------- template <typename T> // 1 - template class struct A { template <T a, size_t b = 0> struct B { enum { value = B<a + b, b + 1>::value }; }; template <T a> // 2 - partly specialization struct B<a, std::numeric_limits<T>::digits> // 3 - specialization using constant from another template { enum { value = a }; }; }; int main() { std::cout << A<size_t>::B<5>::value; } ---------------------------------------------------------- g++ -std=c++0x c.cpp c.cpp:12: error: template instantiation depth exceeds maximum of 500 gcc -v .... gcc version 4.4.3 (Gentoo 4.4.3 p1.0) -- dushistov at mail dot ru changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|FIXED | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43273