Gabriel Dos Reis <[email protected]> writes:
[...]
>> --- a/gcc/cp/parser.c
>> +++ b/gcc/cp/parser.c
>> @@ -22520,10 +22520,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);
>> + }
>> }
>
> Hmm, I am wondering if we shouldn't remove the permerror and make it
> an unconditional error.
Just curious, do we have a rule about when to turn permerrors into
unconditional errors and thus stop providing legacy code bases with a
smooth migration path?
--
Dodji