aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c/c-parser.cc')
-rw-r--r--gcc/c/c-parser.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index 61487cc..24a6eb6 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -3182,7 +3182,19 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs,
attrs_ok = true;
if (kind == C_ID_ID)
{
- error_at (loc, "unknown type name %qE", value);
+ auto_diagnostic_group d;
+ name_hint hint = lookup_name_fuzzy (value, FUZZY_LOOKUP_TYPENAME,
+ loc);
+ if (const char *suggestion = hint.suggestion ())
+ {
+ gcc_rich_location richloc (loc);
+ richloc.add_fixit_replace (suggestion);
+ error_at (&richloc,
+ "unknown type name %qE; did you mean %qs?",
+ value, suggestion);
+ }
+ else
+ error_at (loc, "unknown type name %qE", value);
t.kind = ctsk_typedef;
t.spec = error_mark_node;
}