public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Error message formatting feature request
@ 2010-09-01 19:42 Jeremiah Willcock
  2010-09-01 19:46 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Jeremiah Willcock @ 2010-09-01 19:42 UTC (permalink / raw)
  To: gcc

[-- Attachment #1: Type: TEXT/PLAIN, Size: 809 bytes --]

When compiling a program such as:

template <typename T>
void foo(T, typename T::type c) {c.y();}
struct x {typedef int type;};
void f() {foo(x(), 3);}

GCC 4.5.0 (correctly) produces the error message:

foo.cpp: In function Β‘void foo(T, typename T::type) [with T = x, typename 
T::type = int]Β’:
foo.cpp:4:21:   instantiated from here
foo.cpp:2:34: error: request for member Β‘yΒ’ in Β‘cΒ’, which is of non-class 
type Β‘x::typeΒ’

My feature request is to have the comma between "T = x" and "typename 
T::type = int" replaced by a semicolon.  In larger programs, the types 
given in the error message often themselves contain commas, while they do 
not typically contain semicolons.  Thus, this change would make the error 
messages easier to understand (and, in particular, to skim).

-- Jeremiah Willcock

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

* Re: Error message formatting feature request
  2010-09-01 19:42 Error message formatting feature request Jeremiah Willcock
@ 2010-09-01 19:46 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2010-09-01 19:46 UTC (permalink / raw)
  To: Jeremiah Willcock; +Cc: gcc

Jeremiah Willcock <jewillco@osl.iu.edu> writes:

> When compiling a program such as:
>
> template <typename T>
> void foo(T, typename T::type c) {c.y();}
> struct x {typedef int type;};
> void f() {foo(x(), 3);}
>
> GCC 4.5.0 (correctly) produces the error message:
>
> foo.cpp: In function ‘void foo(T, typename T::type) [with T = x,
> typename T::type = int]’:
> foo.cpp:4:21:   instantiated from here
> foo.cpp:2:34: error: request for member ‘y’ in ‘c’, which is of
> non-class type ‘x::type’
>
> My feature request is to have the comma between "T = x" and "typename
> T::type = int" replaced by a semicolon.  In larger programs, the types
> given in the error message often themselves contain commas, while they
> do not typically contain semicolons.  Thus, this change would make the
> error messages easier to understand (and, in particular, to skim).

Thanks for the suggestion.  Please open a feature request at
http://gcc.gnu.org/bugzilla/ for this.  Otherwise I'm afraid this
suggestion will just be lost in the noise.

Ian

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

end of thread, other threads:[~2010-09-01 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-01 19:42 Error message formatting feature request Jeremiah Willcock
2010-09-01 19:46 ` Ian Lance Taylor

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