🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #695

Overloading method call operator (1.36.2 bug)

#695
From: 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
Technical Details
Message-ID: <8912081712.AA01176@pasillo.aca.mcc.com>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!MCC.COM!lk

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!MCC.COM!lk
From: lk@MCC.COM (Larry Ketcham)
Newsgroups: gnu.g++.bug
Subject: Overloading method call operator (1.36.2 bug)
Message-ID: <8912081712.AA01176@pasillo.aca.mcc.com>
Date: 8 Dec 89 17:12:16 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 52