The attached testcase compiles and runs correctly with gcc 3.3.4, but gives the following compilation errors with gcc 3.4.4:
hashtest.cxx: In function `int main()': hashtest.cxx:11: error: cannot convert `int*' to `std::pair<const int, int>*' in initialization hashtest.cxx:12: error: no matching function for call to `std::allocator<int>::construct(std::pair<const int, int>*&, std::pair<const int, int>&)' /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ext/new_allocator.h:96: note: candidates are: void __gnu_cxx::new_allocator<_Tp>::construct(_Tp*, const _Tp&) [with _Tp = int] hashtest.cxx:17: error: no matching function for call to `std::allocator<int>::destroy(std::pair<const int, int>*&)' /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ext/new_allocator.h:99: note: candidates are: void __gnu_cxx::new_allocator<_Tp>::destroy(_Tp*) [with _Tp = int] hashtest.cxx:18: error: no matching function for call to `std::allocator<int>::deallocate(std::pair<const int, int>*&, int)' /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/ext/new_allocator.h:86: note: candidates are: void __gnu_cxx::new_allocator<_Tp>::deallocate(_Tp*, size_t) [with _Tp = int] The reason for the errors are wrong default allocators in ext/hash_map. A patch that fixes the problem is attached. -- Summary: Wrong default allocator in ext/hash_map Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mattias dot ellert at tsl dot uu dot se CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23528