aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2016-07-20 13:42:51 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2016-07-20 13:42:51 +0000
commitde6a69eea8eda77b8944c538c70620e7d25d5b2b (patch)
tree9b8be09a9ce188671750b4f8e76df99ec445a22c /gcc/c/c-parser.c
parentffc2284012c94620bdbffb5276a264bd7fcf7d91 (diff)
downloadgcc-de6a69eea8eda77b8944c538c70620e7d25d5b2b.zip
gcc-de6a69eea8eda77b8944c538c70620e7d25d5b2b.tar.gz
gcc-de6a69eea8eda77b8944c538c70620e7d25d5b2b.tar.bz2
C: convert return type of lookup_name_fuzzy from tree to const char *
gcc/c-family/ChangeLog: * c-common.h (lookup_name_fuzzy): Convert return type from tree to const char *. gcc/c/ChangeLog: * c-decl.c (implicit_decl_warning): Update for conversion of return type of lookup_name_fuzzy to const char *. (undeclared_variable): Likewise. (lookup_name_fuzzy): Convert return type from tree to const char *. * c-parser.c (c_parser_declaration_or_fndef): Update for conversion of return type of lookup_name_fuzzy to const char *. (c_parser_parameter_declaration): Likewise. gcc/ChangeLog: * gcc-rich-location.c (gcc_rich_location::add_fixit_misspelled_id): New overload, taking a const char *. * gcc-rich-location.h (gcc_rich_location::add_fixit_misspelled_id): Likewise. From-SVN: r238517
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r--gcc/c/c-parser.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 45e32ba..8952bca 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -1698,12 +1698,12 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
}
else
{
- tree hint = lookup_name_fuzzy (name, FUZZY_LOOKUP_TYPENAME);
+ const char *hint = lookup_name_fuzzy (name, FUZZY_LOOKUP_TYPENAME);
if (hint)
{
richloc.add_fixit_misspelled_id (here, hint);
error_at_rich_loc (&richloc,
- "unknown type name %qE; did you mean %qE?",
+ "unknown type name %qE; did you mean %qs?",
name, hint);
}
else
@@ -3853,14 +3853,14 @@ c_parser_parameter_declaration (c_parser *parser, tree attrs)
c_parser_set_source_position_from_token (token);
if (c_parser_next_tokens_start_typename (parser, cla_prefer_type))
{
- tree hint = lookup_name_fuzzy (token->value, FUZZY_LOOKUP_TYPENAME);
+ const char *hint = lookup_name_fuzzy (token->value,
+ FUZZY_LOOKUP_TYPENAME);
if (hint)
{
- gcc_assert (TREE_CODE (hint) == IDENTIFIER_NODE);
gcc_rich_location richloc (token->location);
richloc.add_fixit_misspelled_id (token->location, hint);
error_at_rich_loc (&richloc,
- "unknown type name %qE; did you mean %qE?",
+ "unknown type name %qE; did you mean %qs?",
token->value, hint);
}
else