This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C++ ICE: template + friend + typedef
- To: gcc-bugs at gcc dot gnu dot org
- Subject: C++ ICE: template + friend + typedef
- From: Sylvain Pion <Sylvain dot Pion at sophia dot inria dot fr>
- Date: Wed, 25 Aug 1999 16:38:23 +0200
- Cc: Herve Bronnimann <Herve dot Bronnimann at sophia dot inria dot fr>, Sylvain Pion <Sylvain dot Pion at sophia dot inria dot fr>
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