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