🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Larry Ketcham Fri, 08 Dec 1989 17:12
Overloading method call operator (1.36.2 bug)
#695
Author: Larry Ketcham
Date: Fri, 08 Dec 1989 17:12
52 lines
2178 bytes
Michael,

Using GNU C++ 1.36.2 on Sun3, overloading the method call operator
causes a syntax error, although this compiled OK on 1.34.1.  

Our C++ programs depend heavily on the ability to overload the
method call operator.  A solution would be greatly appreciated.

-------------------arrow.cc--------------------------------------------
class base 
  {
  public:
     operator->() (int , int , ...);
  };

class derived : public base
  {
  public:
    void func (int x);
  };

main () 
  { 
    int i;
    derived *d;
    d->func (i);
  }
-----------------------------------------------------------------------

-----------------------------------------------------------------------
g++-new -v -fall-virtual -g -c arrow.cc -o arrow.o
g++ version 1.36.2 (based on GCC 1.36)
 /usr/local/src/lib/sun3/g++-1.36.2/gcc-cpp -+ -v -undef -D__GNUC__ 
-D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ 
-D__unix__ -D__HAVE_68881__ -Dmc68020 arrow.cc /usr/tmp/cca01155.cpp
GNU CPP version 1.36
 /usr/local/src/lib/sun3/g++-1.36.2/gcc-cc1plus /usr/tmp/cca01155.cpp
-quiet -dumpbase arrow.cc -fall-virtual -g -version -o /usr/tmp/cca01155.s
GNU C++ version 1.36.2 (based on GCC 1.36) (68k, MIT syntax) compiled 
by GNU C version 1.36.
default target switches: -m68020 -mc68020 -m68881 -mbitfield
arrow.cc: In function int main ():
arrow.cc:17: bad argument 0 for function `base::operator ->() (int, int, ...)'
(type was void (class derived ::*)(int ))
-----------------------------------------------------------------------


----------------------------------------------
Larry Ketcham             lk@mcc.com
Experimental Systems      Phone: (512)338-3487
MCC                       
Austin, Texas
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads