[Bug c++/42328] New: rejects valid friend
igodard at pacbell dot net
gcc-bugzilla@gcc.gnu.org
Mon Dec 7 23:04:00 GMT 2009
This code:
template<typename T, typename U>
class freeList {
public:
void foo() {};
};
class bar {};
class baz : protected freeList<bar, baz> {
template<typename T>
friend
void freeList<T, baz>::foo();
};
int main() {
baz b;
return 0;
}
gets you:
s3:~/ootbc/personal/ivan$ g++ foo.cc
foo.cc:12: error: member Âvoid freeList<T, baz>::foo()Â declared as friend
before type ÂfreeList<T, baz>Â defined
FWIW, Comeau accepts it.
--
Summary: rejects valid friend
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42328
More information about the Gcc-bugs
mailing list