lk@MCC.COM (Larry Ketcham) (12/09/89)
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