member-template bug in egcs
Klaus-Georg Adams
Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Wed Nov 19 06:06:00 GMT 1997
I believe the following program should compile:
template <class T> class t {
public:
template <class T2> void access( const t<T2>& x ) { data = x.data; }
private:
int data;
};
int main()
{
t<int> one;
t<long> two;
one.access( two );
return 0;
}
egcs (971105 and 971114) complains:
/egcs/egcs/bin/g++ -o tt tt.C
tt.C: In method `void t<int>::access(const class t<long int> &)':
tt.C:3: member `data' is a private member of class `t<long int>'
Should I be wrong and egcs right, what would be the appropriate friend
declaration to poke this through egcs?
-- kga
-------------------------------------------------------------------------
Klaus-Georg Adams Email: Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Institut f. Anorg. Chemie II Tel: 0721 608 3485
Uni Karlsruhe
-------------------------------------------------------------------------
More information about the Gcc-bugs
mailing list