template problem with 971016
dave madden
dhm@paradigm.webvision.com
Tue Oct 21 12:40:00 GMT 1997
Dunno if this is of any interest or help, but on "gcc version
egcs-2.90.13 971016 (gcc2-970802 experimental)" on an alpha (OSF4.0)
I've encountered a problem with templates: if you try to insert() a a
key-value pair<> into a multimap<>, the signature selection code won't
treat a pair<k,v> as an acceptable match for the pair<const k,v> that
it wants.
BTW, should I do anything special to get egcs to work with
libg++-2.7.2? I get warnings from egcs about the new() and delete()
declared in g++-include/new.h.
regards,
d.
Script started on Tue Oct 21 12:03:03 1997
bash$ cat foo.cc
#include <multimap.h>
typedef multimap<int,char*> intptrmap;
typedef pair<int,char*> intptrpair;
int
main( int /*argc*/, char ** /*argv*/ )
{
intptrmap m;
m.insert( intptrpair( 1, "hello" ) );
}
bash$ egcs -v foo.cc
Reading specs from /usr/local/lib/gcc-lib/alphaev56-dec-osf4.0/egcs-2.90.13/specs
gcc version egcs-2.90.13 971016 (gcc2-970802 experimental)
/usr/local/lib/gcc-lib/alphaev56-dec-osf4.0/egcs-2.90.13/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=90 -Dunix -D__osf__ -D__alpha -D__alpha__ -D_LONGLONG -DSYSTYPE_BSD -D_SYSTYPE_BSD -D__unix__ -D__osf__ -D__alpha -D__alpha__ -D_LONGLONG -D__SYSTYPE_BSD__ -D_SYSTYPE_BSD -D__unix -D__SYSTYPE_BSD -Asystem(unix) -Asystem(xpg4) -Acpu(alpha) -Amachine(alpha) -D__EXCEPTIONS -D__LANGUAGE_C__ -D__LANGUAGE_C -DLANGUAGE_C -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus -I/usr/local/include/SGI-STL foo.cc /tmp/ccaaziua.ii
GNU CPP version egcs-2.90.13 971016 (gcc2-970802 experimental)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/SGI-STL
/usr/local/include/g++
/usr/local/lib/g++-include
/usr/local/include
/usr/local/alphaev56-dec-osf4.0/include
/usr/local/lib/gcc-lib/alphaev56-dec-osf4.0/egcs-2.90.13/include
/usr/include
End of search list.
/usr/local/lib/gcc-lib/alphaev56-dec-osf4.0/egcs-2.90.13/cc1plus /tmp/ccaaziua.ii -quiet -dumpbase foo.cc -version -o /tmp/ccaaziua.s
GNU C++ version egcs-2.90.13 971016 (gcc2-970802 experimental) (alphaev56-dec-osf4.0) compiled by GNU C version 2.7.2.
In file included from /usr/local/lib/g++-include/new.h:6,
from /usr/local/include/SGI-STL/algobase.h:35,
from /usr/local/include/SGI-STL/tree.h:53,
from /usr/local/include/SGI-STL/multimap.h:30,
from foo.cc:1:
/usr/local/lib/g++-include/std/new.h:26: warning: declaration of `operator delete(void *)' throws different exceptions
<internal>:26: warning: previous declaration here
/usr/local/lib/g++-include/std/new.h:27: warning: declaration of `operator delete [](void *)' throws different exceptions
<internal>:27: warning: previous declaration here
foo.cc: In function `int main(int, char **)':
foo.cc:11: no matching function for call to `multimap<int,char *,less<int>,__default_alloc_template<false,0> >::insert (pair<int,char *>)'
/usr/local/include/SGI-STL/multimap.h:138: candidates are: multimap<int,char *,less<int>,__default_alloc_template<false,0> >::insert<int, char *, less<int>, __default_alloc_template<false,0>>(__rb_tree_iterator<pair<const int,char *>,const pair<const int,char *> &,const pair<const int,char *> *>, __rb_tree_iterator<pair<const int,char *>,const pair<const int,char *> &,const pair<const int,char *> *>)
/usr/local/include/SGI-STL/multimap.h:135: multimap<int,char *,less<int>,__default_alloc_template<false,0> >::insert<int, char *, less<int>, __default_alloc_template<false,0>>(const pair<const int,char *> *, const pair<const int,char *> *)
/usr/local/include/SGI-STL/multimap.h:126: multimap<int,char *,less<int>,__default_alloc_template<false,0> >::insert<int, char *, less<int>, __default_alloc_template<false,0>>(__rb_tree_iterator<pair<const int,char *>,pair<const int,char *> &,pair<const int,char *> *>, const pair<const int,char *> &)
/usr/local/include/SGI-STL/multimap.h:125: multimap<int,char *,less<int>,__default_alloc_template<false,0> >::insert<int, char *, less<int>, __default_alloc_template<false,0>>(const pair<const int,char *> &)
bash$ exit
script done on Tue Oct 21 12:03:13 1997
More information about the Gcc
mailing list