mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 03:46:53 -05:00
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: r135182
This commit is contained in:
committed by
Volker Reichelt
parent
5cd95c9672
commit
9ffa368db0
@@ -1,3 +1,9 @@
|
||||
2008-05-11 Volker Reichelt <v.reichelt@netcologne.de>
|
||||
|
||||
PR c++/35578
|
||||
* parser.c (cp_parser_decl_specifier_seq): Add location to error
|
||||
message.
|
||||
|
||||
2008-04-17 Volker Reichelt <v.reichelt@netcologne.de>
|
||||
|
||||
* parser.c (cp_parser_asm_specification_opt): Print CPP_CLOSE_PAREN
|
||||
|
||||
@@ -7595,7 +7595,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
|
||||
case RID_FRIEND:
|
||||
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);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2008-05-11 Volker Reichelt <v.reichelt@netcologne.de>
|
||||
|
||||
PR c++/35578
|
||||
* g++.dg/parse/friend8.C: New test.
|
||||
|
||||
2008-05-01 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR middle-end/36093
|
||||
|
||||
8
gcc/testsuite/g++.dg/parse/friend8.C
Normal file
8
gcc/testsuite/g++.dg/parse/friend8.C
Normal file
@@ -0,0 +1,8 @@
|
||||
// PR c++/35578
|
||||
// Check position of error message
|
||||
// { dg-do compile }
|
||||
|
||||
int i;
|
||||
|
||||
friend // { dg-error "friend" }
|
||||
void foo();
|
||||
Reference in New Issue
Block a user