public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* template problem with 971016
@ 1997-10-21 12:40 dave madden
  1997-10-21 13:48 ` Joe Buck
  0 siblings, 1 reply; 5+ messages in thread
From: dave madden @ 1997-10-21 12:40 UTC (permalink / raw)
  To: egcs

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-10-21 16:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-21 12:40 template problem with 971016 dave madden
1997-10-21 13:48 ` Joe Buck
1997-10-21 15:50   ` dave madden
1997-10-21 15:50     ` Joe Buck
1997-10-21 16:11       ` libg++ header file locations dave madden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).