public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Confusing error message
@ 1998-12-15  9:16 Carlo Wood
  1998-12-15 10:11 ` Nathan Sidwell
  0 siblings, 1 reply; 3+ messages in thread
From: Carlo Wood @ 1998-12-15  9:16 UTC (permalink / raw)
  To: egcs

Hi,

I ran into the following confusing error message:

-------------------------------------------------------------------------------
class A;

bool A::foo(void)
{
  return true;
}
-------------------------------------------------------------------------------

gives:

errmsg.cc:4: no `bool A::foo()' member function declared in class `A'


while the real problem is that I didn't include the correct header file
(but another header file that only contained a forward declaration).

In a large program this can be quite confusing, wouldn't it be better to say:

errmsg.cc:4: class `A' is only a forward declaration.

Or something like that?

-- 
 Carlo Wood  <carlo@runaway.xs4all.nl>

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

* Re: Confusing error message
  1998-12-15  9:16 Confusing error message Carlo Wood
@ 1998-12-15 10:11 ` Nathan Sidwell
  1999-01-31 23:58   ` Jason Merrill
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Sidwell @ 1998-12-15 10:11 UTC (permalink / raw)
  To: Carlo Wood; +Cc: egcs-patches, egcs

Carlo Wood wrote:
> [confusing error message from defining a function in a declared,
> but undefined class]
Yes, it would be better, and here's a patch.

Whilst we're on the issue, what do people think about also reporting
where the declaration of class A is?, ie

nodefn.ii:4: invalid use of undefined type `class A'
nodefn.ii:1: declaration of `class A'

This goes for other cases of reporting undefined type abuses too.

nathan
-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
      You can up the bandwidth, but you can't up the speed of light      
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk

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

* Re: Confusing error message
  1998-12-15 10:11 ` Nathan Sidwell
@ 1999-01-31 23:58   ` Jason Merrill
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Merrill @ 1999-01-31 23:58 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: Carlo Wood, egcs-patches, egcs

Applied, thanks.

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

end of thread, other threads:[~1999-01-31 23:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-15  9:16 Confusing error message Carlo Wood
1998-12-15 10:11 ` Nathan Sidwell
1999-01-31 23:58   ` Jason Merrill

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).