This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: 19980824 member template specialization bugs?
- To: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Subject: Re: 19980824 member template specialization bugs?
- From: "Reid M. Pinchback" <reidmp at MIT dot EDU>
- Date: Wed, 02 Sep 1998 13:31:05 -0400
- Cc: egcs-bugs at cygnus dot com
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 =
====================================================