From: Nathaniel Shead Date: Thu, 25 Sep 2025 11:05:40 +0000 (+1000) Subject: c++/modules: Remove incorrect assertion [PR122015,PR122019] X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4f9f1269f4e929ee471b717b47c33d2d5a3db0d3;p=thirdparty%2Fgcc.git c++/modules: Remove incorrect assertion [PR122015,PR122019] This assertion, despite what I said in r16-4070, is not valid: we can reach here when deduping a VAR_DECL that didn't get a LANG_SPECIFIC in the current TU. It's still correct to always use lang_cplusplus however as for anything else the decl would have been created with an appropriate LANG_SPECIFIC to start with. PR c++/122015 PR c++/122019 gcc/cp/ChangeLog: * module.cc (trees_in::install_entity): Remove incorrect assertion. Signed-off-by: Nathaniel Shead --- diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 7b69e806328..be873c19295 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -8149,7 +8149,6 @@ trees_in::install_entity (tree decl) if (!DECL_LANG_SPECIFIC (not_tmpl)) { maybe_add_lang_decl_raw (not_tmpl, false); - gcc_checking_assert (!VAR_OR_FUNCTION_DECL_P (not_tmpl)); SET_DECL_LANGUAGE (not_tmpl, lang_cplusplus); } DECL_MODULE_ENTITY_P (not_tmpl) = true;