[gnu.g++.bug] g++ rejects valid program

jjc@UUNET.UU.NET (James Clark) (04/02/89)

g++ 1.34.1 rejects a program that seems to me (and cfront)
valid.

Script started on Sat Apr  1 18:37:17 1989
jclark% cat same.c
struct node;

typedef int (*PCOMP)(node *, node *);

struct node {
  virtual PCOMP same_function();
};

struct dnode : node {
  PCOMP same_function();
  friend int same_dnode(dnode *, dnode *);
};

PCOMP dnode::same_function()
{
  return PCOMP(same_dnode);
}
jclark% g++ -v -c same.c
g++ version 1.34.1
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ same.c /tmp/cca26332.cpp
GNU CPP version 1.34
 /usr/local/lib/gcc-c++ /tmp/cca26332.cpp -quiet -dumpbase same.c -version -o /tmp/cca26332.s
GNU C++ version 1.34.1 (sparc) compiled by GNU C version 1.34.
In method dnode::same_function ():
same.c:16: no appropriate type instantiation for overloaded function exists
jclark% exit
jclark% 
script done on Sat Apr  1 18:37:39 1989

James Clark
jjc@jclark.uucp
uunet!mcvax!jclark!jjc