This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30390] New: cannot declare friend class of the parameter type in a template class
- From: "gzljg at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jan 2007 02:54:33 -0000
- Subject: [Bug c++/30390] New: cannot declare friend class of the parameter type in a template class
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
class R{};
class B{
friend class R; // ok.
};
template <typename T> class A{
friend class T; // error???
};
when using g++(3.3.3 or 4.1) to compile above code, it reports:
error: using template type parameter 'T' after 'class'
error: friend declaration does not name a class or function
Pls note that, SunCC works fine for above code.
--
Summary: cannot declare friend class of the parameter type in a
template class
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gzljg at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30390