Skip to content
Snippets Groups Projects
Commit cb76d7e4 authored by Patrick Palka's avatar Patrick Palka
Browse files

c++/modules: ICEs with modular fmtlib


Building modular fmtlib triggered two small modules bugs in C++23 and
C++26 mode respectively (due to libstdc++ header differences).

The first is that a TEMPLATE_DECL having DECL_LANG_SPECIFIC doesn't
necessarily imply that its DECL_TEMPLATE_RESULT has DECL_LANG_SPECIFIC.
So in add_specializations we need to use STRIP_TEMPLATE consistently;
this is a follow-up to r12-7187-gdb84f382ae3dc2.

The second is that get_originating_module_decl was ICEing on class-scope
enumerators injected via using-enum.  I suppose we should handle them
like a class-scope entity rather than a non-using-enum enumerator.

gcc/cp/ChangeLog:

	* module.cc (depset::hash::add_specializations): Use
	STRIP_TEMPLATE consistently.
	(get_originating_module_decl): Handle class-scope CONST_DECL.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/friend-6_a.C: New test.
	* g++.dg/modules/using-enum-3_a.C: New test.
	* g++.dg/modules/using-enum-3_b.C: New test.

Reviewed-by: default avatarJason Merill <jason@redhat.com>
parent ce67b75e
No related branches found
No related tags found
Loading
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