public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ Error message question and suggestion.
@ 1999-08-10  0:19 Kevin Atkinson
  1999-08-10 13:08 ` Martin v. Loewis
  1999-08-31 23:20 ` Kevin Atkinson
  0 siblings, 2 replies; 6+ messages in thread
From: Kevin Atkinson @ 1999-08-10  0:19 UTC (permalink / raw)
  To: gcc

ONE

What does "`const basic_rcon::pair *' is not a class, struct, or union
type" as given by:

map_repl-t.hh: In function `struct
find_substr_return<filter_fitr<filter_itr>,const basic_rcon::pair *>
find_substr<filter_fitr<filter_itr>, filter_fitr_endf<filter_itr>, const
basic_rcon::pair *>(filter_fitr<filter_itr>, const
filter_fitr_endf<filter_itr> &, const basic_rcon::pair *, const
basic_rcon::pair *)':
map_repl-t.hh:75:   instantiated from
`map_repl<char2char,basic_rcon>::fill(char, filter_itr *, simple_buffer
*)'
repl-t.hh:54:   instantiated from
`repl_itr<map_repl<char2char,basic_rcon>,-1,-1>::value()'
map_repl.hh:46:   instantiated from here
map_repl-t.hh:47: `const basic_rcon::pair *' is not a class, struct, or
union type
map_repl-t.hh:48: `const basic_rcon::pair *' is not a class, struct, or
union type

suppose to mean?

TWO

Has any one considered an option to produce better formatted error
messages.  For example:

map_repl-t.hh:75: conversion from
`find_substr_return<filter_fitr<filter_itr>,const basic_rcon::pair *>'
to non-scalar type
`find_substr_return<filter_fitr<filter_itr>,basic_rcon::pair *>'
requested

would be a LOT more readable as:

map_repl-t.hh:75: conversion from:
    find_substr_return<filter_fitr<filter_itr>,
                       const basic_rcon::pair *>
  to non-scalar type:
    find_substr_return<filter_fitr<filter_itr>,
                       basic_rcon::pair *>
  requested.


-- 
Kevin Atkinson
kevinatk@home.com
http://metalab.unc.edu/kevina/

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

* Re: C++ Error message question and suggestion.
  1999-08-10  0:19 C++ Error message question and suggestion Kevin Atkinson
@ 1999-08-10 13:08 ` Martin v. Loewis
  1999-08-10 16:14   ` Kevin Atkinson
  1999-08-31 23:20   ` Martin v. Loewis
  1999-08-31 23:20 ` Kevin Atkinson
  1 sibling, 2 replies; 6+ messages in thread
From: Martin v. Loewis @ 1999-08-10 13:08 UTC (permalink / raw)
  To: kevinatk; +Cc: gcc

> What does "`const basic_rcon::pair *' is not a class, struct, or union
> type" as given by:
[...]
> suppose to mean?

Exactly that: const basic_rcon::pair * is a "pointer type", and
neither a struct, nor a class, nor a union. And - it should be, in the
place where you use it - which is a qualification in a template
instantiation, such as

template<class T>
struct S{
  typename T::foo::bar x;
};

struct A{
  typedef int foo;
};

S<A> X;

Here, template S assumes that T::foo is a class, struct, or union type
which has a nested type "bar" - however, T::foo is `int', hence the
error.

> Has any one considered an option to produce better formatted error
> messages.

Not to my knowledge, no. There have been numerous proposals for
improving the error messages, but none that deals with reformatting
them to be more readable. If you can find an algorithm that makes it
more readable, a patch to the compiler would be most welcome.

Regards,
Martin

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

* Re: C++ Error message question and suggestion.
  1999-08-10 13:08 ` Martin v. Loewis
@ 1999-08-10 16:14   ` Kevin Atkinson
  1999-08-31 23:20     ` Kevin Atkinson
  1999-08-31 23:20   ` Martin v. Loewis
  1 sibling, 1 reply; 6+ messages in thread
From: Kevin Atkinson @ 1999-08-10 16:14 UTC (permalink / raw)
  To: Martin v. Loewis; +Cc: gcc

"Martin v. Loewis" wrote:
> 
> > What does "`const basic_rcon::pair *' is not a class, struct, or union
> > type" as given by:
> [...]
> > suppose to mean?
> 
> Exactly that: const basic_rcon::pair * is a "pointer type", and
> neither a struct, nor a class, nor a union. And - it should be, in the
> place where you use it - which is a qualification in a template
> instantiation, such as


I figured out what it meant eventually.  The message should really be
more descriptive such as.

the type "const basic_rcon::pair *" is a pointer and pointers do not
have member functions.   

or

the type "const basic_rcon::pair *" is a pointer and pointers do not
have nested classed or typedefs.

depednig on what the user is attempting to do.

> > Has any one considered an option to produce better formatted error
> > messages.
> 
> Not to my knowledge, no. There have been numerous proposals for
> improving the error messages, but none that deals with reformatting
> them to be more readable. If you can find an algorithm that makes it
> more readable, a patch to the compiler would be most welcome.

I might work on that if I have the time.
-- 
Kevin Atkinson
kevinatk@home.com
http://metalab.unc.edu/kevina/

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

* Re: C++ Error message question and suggestion.
  1999-08-10 16:14   ` Kevin Atkinson
@ 1999-08-31 23:20     ` Kevin Atkinson
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Atkinson @ 1999-08-31 23:20 UTC (permalink / raw)
  To: Martin v. Loewis; +Cc: gcc

"Martin v. Loewis" wrote:
> 
> > What does "`const basic_rcon::pair *' is not a class, struct, or union
> > type" as given by:
> [...]
> > suppose to mean?
> 
> Exactly that: const basic_rcon::pair * is a "pointer type", and
> neither a struct, nor a class, nor a union. And - it should be, in the
> place where you use it - which is a qualification in a template
> instantiation, such as


I figured out what it meant eventually.  The message should really be
more descriptive such as.

the type "const basic_rcon::pair *" is a pointer and pointers do not
have member functions.   

or

the type "const basic_rcon::pair *" is a pointer and pointers do not
have nested classed or typedefs.

depednig on what the user is attempting to do.

> > Has any one considered an option to produce better formatted error
> > messages.
> 
> Not to my knowledge, no. There have been numerous proposals for
> improving the error messages, but none that deals with reformatting
> them to be more readable. If you can find an algorithm that makes it
> more readable, a patch to the compiler would be most welcome.

I might work on that if I have the time.
-- 
Kevin Atkinson
kevinatk@home.com
http://metalab.unc.edu/kevina/

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

* C++ Error message question and suggestion.
  1999-08-10  0:19 C++ Error message question and suggestion Kevin Atkinson
  1999-08-10 13:08 ` Martin v. Loewis
@ 1999-08-31 23:20 ` Kevin Atkinson
  1 sibling, 0 replies; 6+ messages in thread
From: Kevin Atkinson @ 1999-08-31 23:20 UTC (permalink / raw)
  To: gcc

ONE

What does "`const basic_rcon::pair *' is not a class, struct, or union
type" as given by:

map_repl-t.hh: In function `struct
find_substr_return<filter_fitr<filter_itr>,const basic_rcon::pair *>
find_substr<filter_fitr<filter_itr>, filter_fitr_endf<filter_itr>, const
basic_rcon::pair *>(filter_fitr<filter_itr>, const
filter_fitr_endf<filter_itr> &, const basic_rcon::pair *, const
basic_rcon::pair *)':
map_repl-t.hh:75:   instantiated from
`map_repl<char2char,basic_rcon>::fill(char, filter_itr *, simple_buffer
*)'
repl-t.hh:54:   instantiated from
`repl_itr<map_repl<char2char,basic_rcon>,-1,-1>::value()'
map_repl.hh:46:   instantiated from here
map_repl-t.hh:47: `const basic_rcon::pair *' is not a class, struct, or
union type
map_repl-t.hh:48: `const basic_rcon::pair *' is not a class, struct, or
union type

suppose to mean?

TWO

Has any one considered an option to produce better formatted error
messages.  For example:

map_repl-t.hh:75: conversion from
`find_substr_return<filter_fitr<filter_itr>,const basic_rcon::pair *>'
to non-scalar type
`find_substr_return<filter_fitr<filter_itr>,basic_rcon::pair *>'
requested

would be a LOT more readable as:

map_repl-t.hh:75: conversion from:
    find_substr_return<filter_fitr<filter_itr>,
                       const basic_rcon::pair *>
  to non-scalar type:
    find_substr_return<filter_fitr<filter_itr>,
                       basic_rcon::pair *>
  requested.


-- 
Kevin Atkinson
kevinatk@home.com
http://metalab.unc.edu/kevina/

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

* Re: C++ Error message question and suggestion.
  1999-08-10 13:08 ` Martin v. Loewis
  1999-08-10 16:14   ` Kevin Atkinson
@ 1999-08-31 23:20   ` Martin v. Loewis
  1 sibling, 0 replies; 6+ messages in thread
From: Martin v. Loewis @ 1999-08-31 23:20 UTC (permalink / raw)
  To: kevinatk; +Cc: gcc

> What does "`const basic_rcon::pair *' is not a class, struct, or union
> type" as given by:
[...]
> suppose to mean?

Exactly that: const basic_rcon::pair * is a "pointer type", and
neither a struct, nor a class, nor a union. And - it should be, in the
place where you use it - which is a qualification in a template
instantiation, such as

template<class T>
struct S{
  typename T::foo::bar x;
};

struct A{
  typedef int foo;
};

S<A> X;

Here, template S assumes that T::foo is a class, struct, or union type
which has a nested type "bar" - however, T::foo is `int', hence the
error.

> Has any one considered an option to produce better formatted error
> messages.

Not to my knowledge, no. There have been numerous proposals for
improving the error messages, but none that deals with reformatting
them to be more readable. If you can find an algorithm that makes it
more readable, a patch to the compiler would be most welcome.

Regards,
Martin

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-10  0:19 C++ Error message question and suggestion Kevin Atkinson
1999-08-10 13:08 ` Martin v. Loewis
1999-08-10 16:14   ` Kevin Atkinson
1999-08-31 23:20     ` Kevin Atkinson
1999-08-31 23:20   ` Martin v. Loewis
1999-08-31 23:20 ` Kevin Atkinson

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