Article View: gnu.g++.bug
Article #100(none)
From: Mike Stump
Date: Mon, 20 Jul 1992 15:56
Date: Mon, 20 Jul 1992 15:56
52 lines
2495 bytes
2495 bytes
This problem should not exist in the next release of gcc.
> From: skohn@cs.ucsd.edu (Scott Kohn)
> Message-Id: <35055@sdcc12.ucsd.edu>
> Date: 25 Jun 92 21:41:55 GMT
> Organization: UC-San Diego CSE Department
> To: bug-g++@prep.ai.mit.edu
> Sorry if this is a repost of this bug, but I don't remember seeing it...
> There is a bug with template unification when there exist other overloaded
> functions of the same type. For example, compiling:
> ---------------------------------------------------------------------------
> class X { public: X() { } };
> class Y { public: Y() { } };
> X& operator << (X& x, const int z) { return(x); }
> template <class T> Y& operator << (Y& y, const T& z) { return(y); }
> main(int argc, char **argv)
> {
> X x;
> Y y;
> x << 1;
> y << 1;
> }
> ---------------------------------------------------------------------------
> with gcc-2.2.2 (Sparc) will result in an unimplemented template unification
> message from line 1806 of cp-pt.c:
> sorry ("use of `%s' in template type unification",
> tree_code_name [(int) TREE_CODE (parm)]);
> Reading specs from /usr/gnu/lib/gcc-lib/sun4-sunos4.1/2.2.2/specs
> gcc version 2.2.2
> /usr/gnu/lib/gcc-lib/sun4-sunos4.1/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix unify.c /usr/tmp/cca06799.i
> GNU CPP version 2.2.2 (sparc)
> /usr/gnu/lib/gcc-lib/sun4-sunos4.1/2.2.2/cc1plus /usr/tmp/cca06799.i -quiet -dumpbase unify.cc -version -o /usr/tmp/cca06799.s
> GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
> unify.c:13: sorry, not implemented: use of `record_type' in template type unification
> unify.c:13: sorry, not implemented: use of `record_type' in template type unification
> unify.c:13: sorry, not implemented: use of `record_type' in template type unification
> unify.c:13: sorry, not implemented: use of `record_type' in template type unification
> If the sorry(...) function call is #ifdef'ed out, the function
> unification proceeds correctly.
Technical Details
Message-ID:
<9207201556.AA20309@cygnus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrsShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!mrs From: mrs@cygnus.com (Mike Stump) Subject: (none) Message-ID: <9207201556.AA20309@cygnus.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Mon, 20 Jul 1992 15:56:40 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 53