[Bug c++/30390] New: cannot declare friend class of the parameter type in a template class
gzljg at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Sat Jan 6 02:54:00 GMT 2007
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
More information about the Gcc-bugs
mailing list