This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15897] New: cannot declare template friend decls of member functions
- From: "thomas dot rudlof at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jun 2004 15:52:59 -0000
- Subject: [Bug c++/15897] New: cannot declare template friend decls of member functions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
According to ISO/IEC 14882:1998(E) 14.5.3 clause 6, this code should compile:
template<class T> struct A
{
void foo();
};
class B
{
template<class T> void A<T>::foo();
};
But trying so results in:
trudolf-l4:~/c> g++ friend.cc
friend.cc:10: cannot declare member function `A<T>::foo' within `B'
trudolf-l4:~/c> g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
--
Summary: cannot declare template friend decls of member functions
Product: gcc
Version: 3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: thomas dot rudlof at gmx dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15897