https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106430
Bug ID: 106430 Summary: [modules] ICE on function result of imported type with user-declared constexpr destructor Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/Tr575rbj9. mod.cpp: ```C++ export module mod; struct X { bool b = true; constexpr ~X() { } }; export constexpr X f() { return {}; } ``` test.cpp: ```C++ import mod; static_assert(f().b); int main() { } ``` Output: ``` test.cpp:2:21: in 'constexpr' expansion of 'f@mod()()' test.cpp:2:21: internal compiler error: in cxx_eval_call_expression, at cp/constexpr.cc:2850 2 | static_assert(f().b); | ^ 0x23010ce internal_error(char const*, ...) ???:0 0xa8f3bc fancy_abort(char const*, int, char const*) ???:0 0xaf4d0c maybe_constant_value(tree_node*, tree_node*, bool) ???:0 0xce57cf finish_static_assert(tree_node*, tree_node*, unsigned int, bool, bool) ???:0 0xc656d7 c_parse_file() ???:0 0xd9ec99 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. ```