https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118190
Bug ID: 118190 Summary: ICE: in tsubst_expr, at cp/pt.cc:22244 Product: gcc Version: 14.2.1 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rush102333 at gmail dot com Target Milestone: --- Hello! I encountered an ICE on GCC when I was trying to run the official test suite on the latest version of the compiler and forgot to type a corresponding '}' specifier by accident. I have tried to simplify the code: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #define SA(X) static_assert(X, #X) struct S2 { struct V { }; template<typename T> struct S5 { void f1() noexcept(noexcept(i)) { } int i; }; S5<int> s5; SA(noexcept(s5.f1())); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Please check https://godbolt.org/z/GEYde8dod. Compiler Output: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <source>: In instantiation of 'void S2::S5<T>::f1() [with T = int]': <source>:13:1: required from here 13 | SA(noexcept(s5.f1())); | ~~~~~^~ <source>:8:8: internal compiler error: in tsubst_expr, at cp/pt.cc:22244 8 | void f1() noexcept(noexcept(i)) { } | ^~ 0x2938075 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x294ee76 internal_error(char const*, ...) ???:0 0xacaf50 fancy_abort(char const*, int, char const*) ???:0 0xd1fb02 maybe_instantiate_noexcept(tree_node*, int) ???:0 0xbcf9da mark_used(tree_node*, int) ???:0 0xaeba53 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**, int) ???:0 0xd65d15 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ???:0 0xce5603 c_parse_file() ???:0 0xe450d9 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~