https://gcc.gnu.org/g:bc0ca75123b5996773628981a8bab865440fdf3c
commit r15-4121-gbc0ca75123b5996773628981a8bab865440fdf3c Author: Jason Merrill <ja...@redhat.com> Date: Fri Oct 4 22:23:04 2024 -0400 c++: -Wmismatched-tags and modules In Wmismatched-tags-6.C, we try to compare two declarations of the Cp alias template, and ICE trying to check whether they're in module purview. We need to check DECL_LANG_SPECIFIC like elsewhere in the compiler. gcc/cp/ChangeLog: * decl.cc (duplicate_decls): Only check PURVIEW_P if DECL_LANG_SPECIFIC. Diff: --- gcc/cp/decl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 07fb9855cd20..0c5b5c06a12e 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -2530,7 +2530,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden) /* Propagate purviewness and importingness as with set_instantiating_module. */ - if (modules_p ()) + if (modules_p () && DECL_LANG_SPECIFIC (new_result)) { if (DECL_MODULE_PURVIEW_P (new_result)) DECL_MODULE_PURVIEW_P (old_result) = true;