Skip to content
Snippets Groups Projects
Commit bbb30f12 authored by Nathaniel Shead's avatar Nathaniel Shead
Browse files

c++: Fix error recovery when redeclaring enum in different module [PR99573]


This ensures that with modules enabled, redeclaring an enum in the wrong
module or with the wrong underlying type no longer ICEs.

The patch also rearranges the order of the checks a little because I
think it's probably more important to note that you can't redeclare the
enum all before complaining about mismatched underlying types etc.

As a drive by this patch also adds some missing diagnostic groups, and
rewords the module redeclaration error message to more closely match the
wording used in other places this check is done.

	PR c++/99573

gcc/cp/ChangeLog:

	* decl.cc (start_enum): Reorder check for redeclaring in module.
	Add missing auto_diagnostic_groups.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/enum-12.C: New test.

Signed-off-by: default avatarNathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: default avatarJason Merrill <jason@redhat.com>
parent d79aa77d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment