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]

C++ ICE: template + friend + typedef


Hi,

The code below produces an ICE with gcc 2.95.1, as well as the 19990824
snapshot, on Solaris as well as Linux.  egcs-1.1.2 worked perfectly.

--------------------------
// class A;

template < class R >
struct B
{ 
  typedef int A;
  friend class A;
};
--------------------------

The ICE disappears if you either:
- uncomment "// class A;", or
- remove "template < class R >", or
- remove "typedef int A;", or
- change "friend class A;" to "friend A;".

BTW, is it valid C++ ?  It shouldn't crash anyway.

-- 
Sylvain


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