This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: funny syntactical error message





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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]