19980824 member template specialization bugs?
Reid M. Pinchback
reidmp@MIT.EDU
Wed Sep 2 12:08:00 GMT 1998
At 11:52 PM 9/1/98 -0300, you wrote:
>BTW, as I tried to modify your test case so that it would compile, I
>found out that the following code snippet will cause an ICE in
>egcs-1.1: Mark? Jason? Should I install it in the testsuite?
>
>template <class X> class bug { template <class Y> class a {}; };
>template <class X> template <> class bug<X>::a<char> {};
>
I just hit a variation of the same thing myself, where the templated
member is a function.
template <class X> struct bug { template <class Y> void f(Y y) {} };
template <class X> template <> void bug<X>::f<>(X x) {}
main(int argc, char * argv[]) {
bug<int> b; b.f(1);
}
This results in "Internal compiler error 40". Same thing happens if
"f<>(X x)" is replaced by "f<X>(X x)" or "f<X>(char x)", but the ICE
goes away when "f<>(X x)" is replaced by "f<int>(X x)".
====================================================
= Reid M. Pinchback =
= I/T Delivery, MIT =
= =
= Email: reidmp@mit.edu =
= URL: http://web.mit.edu/reidmp/www/home.html =
====================================================
More information about the Gcc-bugs
mailing list