Strange template behaviour with gcc 3.4 (20030813 and 20031001)
Mihnea Balta
dark_lkml@mymail.ro
Mon Oct 6 10:19:00 GMT 2003
Hello,
I'd like to know if this is a bug in the experimental gcc I'm using or if I'm
doing something wrong:
template<class A, class B>
struct pair_t{
A first;
B second;
};
template<class A, class B>
class something_t : public pair_t<A, B>{
public:
void strange(A i){
first = i;
}
};
int main(){
return 0;
}
The compiler reports that "first" is undeclared in the someting_t::strange()
method. I tried with gcc 2.95.3 and it compiles fine, and unfortunately I
don't have access to any stable gcc 3.x compiler to try on that too. Is this
syntax in violation of any part of the standards, or is it just a bug in gcc?
PS: if this has been already reported as a bug for gcc 3.4, I appologise but I
couldn't find it.
More information about the Gcc-help
mailing list