aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 9e7a398..daf2ded 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -22544,10 +22544,14 @@ static void
cp_parser_check_class_key (enum tag_types class_key, tree type)
{
if ((TREE_CODE (type) == UNION_TYPE) != (class_key == union_type))
- permerror (input_location, "%qs tag used in naming %q#T",
- class_key == union_type ? "union"
- : class_key == record_type ? "struct" : "class",
- type);
+ {
+ permerror (input_location, "%qs tag used in naming %q#T",
+ class_key == union_type ? "union"
+ : class_key == record_type ? "struct" : "class",
+ type);
+ inform (DECL_SOURCE_LOCATION (TYPE_NAME (type)),
+ "%q#T was previously declared here", type);
+ }
}
/* Issue an error message if DECL is redeclared with different