g++ (GCC) 3.4.3-20050110 (Gentoo 3.4.3.20050110-r2, ssp-3.4.3.20050110-0, pie-8.7.7) is unable to report that the code is invalid and crashes instead. Reproducible: Always Steps to Reproduce: 1. test.cpp: #include <iostream> #include <ostream> template <int> struct foo; template<> struct foo<0> { typedef int t; }; int main() { std::cout<< typename foo<0>::t(42); } 2. g++ test.cpp -o test Actual Results: src/main.cpp: In function `int main()': src/main.cpp:14: internal compiler error: Segmentation fault Expected Results: The g++ should've reported that it isn't valid C++.
Created attachment 67157 [details] Preprocessed source
3.4.5 handles this error correctly. I'll make sure the patch applies cleanly to 3.4.4 later and throw it into CVS for the next patchset.
The patch applies cleanly, but wrongly accepts the code. 3.4.5 and above are fixed for this issue though.