This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR c++/35578: Misplaced error message for invalid use of 'friend'
- From: Tom Tromey <tromey at redhat dot com>
- To: Volker Reichelt <v dot reichelt at netcologne dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 30 Mar 2008 08:26:17 -0600
- Subject: Re: [PATCH] Fix PR c++/35578: Misplaced error message for invalid use of 'friend'
- References: <tkrat.d1526ac24efbc8aa@netcologne.de>
- Reply-to: tromey at redhat dot com
>>>>> "Volker" == Volker Reichelt <v.reichelt@netcologne.de> writes:
Volker> The patch below fixes a diagnostic problem in the C++ parser.
Volker> The error message for invalid usages of `friend' would sometimes
Volker> be in the wrong line. Fixed by adding the location of the keyword
Volker> to the error message.
Volker> +friend void foo(); // { dg-error "friend" }
One suggestion Joseph Myers had for tests like this was to put the
"error location" token on its own line in the test case. That way we
will ensure that we're emitting the correct location in the future.
Something like:
friend // { dg-error "friend" }
void foo();
BTW thanks for looking at this. Both the C++ parser and a lot of the
C/C++ common code need an error-location audit.
Tom