This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 19980824 member template specialization bugs?


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 =
====================================================



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]