public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* funny syntactical error message
@ 2000-03-08  3:35 Ulrich Lauther
  2000-03-08 13:12 ` Martin v. Loewis
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Lauther @ 2000-03-08  3:35 UTC (permalink / raw)
  To: gcc

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

----------------------------------------------------------------------------
Ulrich Lauther          ph: +49 89 636 48834 fx: ... 636 42284
Siemens ZT SE 4         Internet: Ulrich.Lauther@mchp.siemens.de

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: funny syntactical error message
@ 2000-03-08 10:24 rlau
  2000-03-08 10:41 ` Mo McKinlay
  0 siblings, 1 reply; 4+ messages in thread
From: rlau @ 2000-03-08 10:24 UTC (permalink / raw)
  To: gcc, Ulrich.Lauther

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-03-08 13:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-08  3:35 funny syntactical error message Ulrich Lauther
2000-03-08 13:12 ` Martin v. Loewis
2000-03-08 10:24 rlau
2000-03-08 10:41 ` Mo McKinlay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).