[gnu.g++.bug] g++ 1.35.1- dumps core on erroneous "pointer-to-member" usage.

bryan@UUNET.UU.NET (Bryan Boreham) (06/14/89)

The example:

extern "C" char* strcpy(char*, char*);

class Object;

typedef void* (Object::*PROC)(...);

class Object
{
 public:
  void getValue(PROC ptr, char* retValue)
    {
      strcpy(retValue, this->(*ptr));
    }
};

kewill% g++ -c -v bug3.cc
g++ version 1.35.1-
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dmc6800
0 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 bug
3.cc /tmp/cca02102.cpp
GNU CPP version 1.35
 /usr/local/lib/gcc-cc1plus /tmp/cca02102.cpp -quiet -dumpbase bug3.cc -noreg -v
ersion -o /tmp/cca02102.s
GNU C++ version 1.35.1- (68k, MIT syntax) compiled by GNU C version 1.35.
bug3.cc:5: warning: lazy prototyping frowned upon
g++: Program cc1plus got fatal signal 6.

I know the code is wrong. As an aside, is there a way to make g++ shut
up about the lazy prototyping in places where I really do need it?

Or maybe I don't really need it, and someone can tell me more.


Bryan Boreham           {The Atlantic} ... mcvax!ukc!root44!kewill!bryan
Software Engineer
Kewill Systems PLC      Work: (+44) 932 248 328
Walton-On-Thames
Surrey KT12 2QS
England                 PS: I got the ET++ collections to work!