internal compiler error with friend/templates/namespace
Dimitri PAPADOPOULOS-ORFANOS
papadopo@shfj.cea.fr
Tue Apr 18 09:15:00 GMT 2000
Hi,
This is GCC 2.95.2 19991024 and I get an internal compiler error
while trying to compile this:
namespace me {
template <typename T>
class rc_ptr {
template <typename U> friend class rc_ptr;
};
}
I won't swear the code is correct. I am trying to tell the compiler
that rc_ptr<U> for any type U should be a friend of rc_ptr<T>. This
is probably not possible I guess...
$ g++ -v
Reading specs from
/usr/local/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/specs
gcc version 2.95.2 19991024 (release)
$ cat foo.cc
namespace me {
template <typename T>
class rc_ptr {
template <typename U> friend class rc_ptr;
};
}
$ g++ -c foo.cc
foo.cc:5: Internal compiler error.
foo.cc:5: Please submit a full bug report.
foo.cc:5: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for
instructions.
$
Regards,
Dimitri Papadopoulos
More information about the Gcc-bugs
mailing list