Commit adcc62c7 by Volker Reichelt Committed by Volker Reichelt

re PR c++/35578 (Error about misplaced 'friend' word is issued on a wrong line)

	PR c++/35578
	* parser.c (cp_parser_decl_specifier_seq): Add location to error
	message.

	* g++.dg/parse/friend8.C: New test.

From-SVN: r133738
parent 39ffbac9
2008-03-30 Volker Reichelt <v.reichelt@netcologne.de>
PR c++/35578
* parser.c (cp_parser_decl_specifier_seq): Add location to error
message.
2008-03-27 Tom Tromey <tromey@redhat.com> 2008-03-27 Tom Tromey <tromey@redhat.com>
* Make-lang.in: Revert automatic dependency patch. * Make-lang.in: Revert automatic dependency patch.
......
...@@ -8103,7 +8103,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser, ...@@ -8103,7 +8103,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
case RID_FRIEND: case RID_FRIEND:
if (!at_class_scope_p ()) if (!at_class_scope_p ())
{ {
error ("%<friend%> used outside of class"); error ("%H%<friend%> used outside of class", &token->location);
cp_lexer_purge_token (parser->lexer); cp_lexer_purge_token (parser->lexer);
} }
else else
......
2008-03-30 Volker Reichelt <v.reichelt@netcologne.de> 2008-03-30 Volker Reichelt <v.reichelt@netcologne.de>
PR c++/35578
* g++.dg/parse/friend8.C: New test.
PR c/35748 PR c/35748
* gcc.dg/union-cast-4.c: New test. * gcc.dg/union-cast-4.c: New test.
// PR c++/35578
// Check position of error message
// { dg-do compile }
int i;
friend // { dg-error "friend" }
void foo();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment