summaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index d767797550a..88d0b2b250d 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -13382,7 +13382,9 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
case RID_FRIEND:
if (!at_class_scope_p ())
{
- error_at (token->location, "%<friend%> used outside of class");
+ gcc_rich_location richloc (token->location);
+ richloc.add_fixit_remove ();
+ error_at_rich_loc (&richloc, "%<friend%> used outside of class");
cp_lexer_purge_token (parser->lexer);
}
else
@@ -13444,10 +13446,13 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
/* Consume the token. */
cp_lexer_consume_token (parser->lexer);
- /* Complain about `auto' as a storage specifier, if
- we're complaining about C++0x compatibility. */
- warning_at (token->location, OPT_Wc__11_compat, "%<auto%>"
- " changes meaning in C++11; please remove it");
+ /* Complain about `auto' as a storage specifier, if
+ we're complaining about C++0x compatibility. */
+ gcc_rich_location richloc (token->location);
+ richloc.add_fixit_remove ();
+ warning_at_rich_loc (&richloc, OPT_Wc__11_compat,
+ "%<auto%> changes meaning in C++11; "
+ "please remove it");
/* Set the storage class anyway. */
cp_parser_set_storage_class (parser, decl_specs, RID_AUTO,