funny syntactical error message

rlau@csc.com rlau@csc.com
Wed Mar 8 10:24:00 GMT 2000


In the inline function access, are you trying to return a specific element of
bar[] ?  If so, your syntax might be the source of the problem.
Try
return bar[i];

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Compilation of

class foo {
  public:
  int fudge[40];
  int bar  [40];
  inline int access(int i) {
    return bar(i);
  }
};

gives
test.C:7: `(this + 160)' cannot be used as a function

if fudge is ommitted, you get
test.C:7: `this' cannot be used as a function

Why not "bar cannot be used as a function?"

(this is 2.95.1)
--
     -lauther




More information about the Gcc mailing list