Problem with g++ and stl

Carl Mailloux Servtech@mediom.qc.ca
Wed Dec 22 06:36:00 GMT 1999


With g++ 2.95.2 on sco openserver 5.0.5, this 
code do not compile.
 
 #include 
<stack>    class MaClass   {   typedef 
void (MaClass::*UneFonction)(int,int);   std::stack<UneFonction> 
UnePile;   public:    MaClass() {}   
};    int main(int /*argc*/,char 
*/*argv*/[])  {   return 0;  }   Error 
Message :
   /usr/local/lib/gcc-lib/i686-pc-sco3.2v5.0.5/2.95.1/../../../../include/g++-3  /stl_alloc.h: 
In instantiation of `allocator<void (MaClass::*)(int, 
int)>':  /usr/local/lib/gcc-lib/i686-pc-sco3.2v5.0.5/2.95.1/../../../../include/g++-3  /stl_stack.h:54:   
instantiated from `stack<void (MaClass::*)(int,  int),deque<void ( 
MaClass::*)(int, int),allocator<void (MaClass::*)(int,  int),0> 
>::stack()'  cpptest.cpp:8:   instantiated from 
here  /usr/local/lib/gcc-lib/i686-pc-sco3.2v5.0.5/2.95.1/../../../../include/g++-3  /stl_alloc.h:750: 
`allocator<void (MaClass::*)(int, 
int)>::address(void  (MaClass::*&)(int, int)) const' has already 
been declared in `allocator<void  (MaClass::*)(int, 
int)>'
 
Carl Mailloux
servtech@mediom.qc.ca
or
carlm@oricom.ca
 



More information about the Gcc-bugs mailing list