[Prev][Next][Index]

Re: operator= parse error



Adam,
this bug has been fixed in the latest version.  (along with
a host of other C++ bugs.  the new version will be ready
for you to ftp today or tomorrow.)

also, in this new version templates work much better and
there are more examples that show how to construct complex
things in sage.

but things are still far from where we would like them
to be.  the newest version of the parser is much better,
but it still has limitations.  we are currently working on
a new parser that will be very faithfull in matching the
ansi draft spec.

one more thing.  though your example now works, it still
has some type checking problems.  not the output below
and be warned to not take the warnings too seriously.
regards,
d.
_____________________________________________________
rainier:~/HPC++/unparse_test(319)> cat oper2.c
class test {
public:
  test& operator=(test& t) { return t; }
};

int main() {
  test a, b;

  a = b;
  a.operator=(b);
}

rainier:~/HPC++/unparse_test(320)> pc++ -unparse oper2.c
Warning on line 10 of oper2.c:  = :possible member function arg type missmatch
class  test {
public:
public:
       test &  operator =(test &t){
          return t;
       }
 
};
int  main(){
       test a, b;
       a = b;
       a.operator =(b);
}