https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104646
Bug ID: 104646 Summary: [9/10/11/12 Regression] ICE in cx_check_missing_mem_inits, at cp/constexpr.cc:845 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Seems to have started with r7 (r6 seems to compile it) : (gcc configured with --enable-checking=yes) $ cat z1.cc #include <regex> #include <string> int main() { const std::string str = "abc"; std::regex re; re = std::regex("^[0-9]$"); return std::regex_search(str, re); } $ g++-12-20220220 -c z1.cc -fno-elide-constructors In file included from .../include/c++/12.0.1/bits/stl_algobase.h:64, from .../include/c++/12.0.1/string:50, from .../include/c++/12.0.1/bitset:47, from .../include/c++/12.0.1/regex:38, from z1.cc:1: .../include/c++/12.0.1/bits/stl_pair.h: In instantiation of 'void std::__detail::_Executor< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3>, <anonymous> >::_M_rep_once_more(_Match_mode, std::__detail::_StateIdT) [with _BiIter = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >; _TraitsT = std::__cxx11::regex_traits<char>; bool __dfs_mode = false; std::__detail::_StateIdT = long int]': .../include/c++/12.0.1/bits/regex_executor.tcc:212:4: required from 'void std::__detail::_Executor< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3>, <anonymous> >::_M_handle_repeat(_Match_mode, std::__detail::_StateIdT) [with _BiIter = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >; _TraitsT = std::__cxx11::regex_traits<char>; bool __dfs_mode = false; std::__detail::_StateIdT = long int]' .../include/c++/12.0.1/bits/regex_executor.tcc:515:4: required from 'void std::__detail::_Executor< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3>, <anonymous> >::_M_dfs(_Match_mode, std::__detail::_StateIdT) [with _BiIter = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >; _TraitsT = std::__cxx11::regex_traits<char>; bool __dfs_mode = false; std::__detail::_StateIdT = long int]' .../include/c++/12.0.1/bits/regex_executor.tcc:130:8: required from 'bool std::__detail::_Executor< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3>, <anonymous> >::_M_main_dispatch(_Match_mode, __bfs) [with _BiIter = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >; _TraitsT = std::__cxx11::regex_traits<char>; bool __dfs_mode = false; __bfs = std::integral_constant<bool, false>]' .../include/c++/12.0.1/bits/regex_executor.h:149:32: required from 'bool std::__detail::_Executor< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3>, <anonymous> >::_M_main(_Match_mode) [with _BiIter = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >; _TraitsT = std::__cxx11::regex_traits<char>; bool __dfs_mode = false]' .../include/c++/12.0.1/bits/regex_executor.h:93:9: required from 'bool std::__detail::_Executor< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3>, <anonymous> >::_M_match() [with _BiIter = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >; _TraitsT = std::__cxx11::regex_traits<char>; bool __dfs_mode = false]' .../include/c++/12.0.1/bits/regex.tcc:71:33: required from 'bool std::__detail::__regex_algo_impl(_BiIter, _BiIter, std::__cxx11::match_results<_BiIter, _Alloc>&, const std::__cxx11::basic_regex<_CharT, _TraitsT>&, std::regex_constants::match_flag_type, _RegexExecutorPolicy, bool) [with _BiIter = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >; _CharT = char; _TraitsT = std::__cxx11::regex_traits<char>]' .../include/c++/12.0.1/bits/regex.h:2364:41: required from 'bool std::regex_search(_Bi_iter, _Bi_iter, __cxx11::match_results<_BiIter, _Alloc>&, const __cxx11::basic_regex<_CharT, _TraitsT>&, regex_constants::match_flag_type) [with _Bi_iter = __gnu_cxx::__normal_iterator<const char*, __cxx11::basic_string<char> >; _Alloc = allocator<__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, __cxx11::basic_string<char> > > >; _Ch_type = char; _Rx_traits = __cxx11::regex_traits<char>]' .../include/c++/12.0.1/bits/regex.h:2387:26: required from 'bool std::regex_search(_Bi_iter, _Bi_iter, const __cxx11::basic_regex<_Ch_type, _Rx_traits>&, regex_constants::match_flag_type) [with _Bi_iter = __gnu_cxx::__normal_iterator<const char*, __cxx11::basic_string<char> >; _Ch_type = char; _Rx_traits = __cxx11::regex_traits<char>]' .../include/c++/12.0.1/bits/regex.h:2447:26: required from 'bool std::regex_search(const __cxx11::basic_string<_Ch_type, _Ch_traits, _Str_allocator>&, const __cxx11::basic_regex<_CharT, _TraitsT>&, regex_constants::match_flag_type) [with _Ch_traits = char_traits<char>; _String_allocator = allocator<char>; _Ch_type = char; _Rx_traits = __cxx11::regex_traits<char>]' z1.cc:7:27: required from here .../include/c++/12.0.1/bits/stl_pair.h:195:17: internal compiler error: in cx_check_missing_mem_inits, at cp/constexpr.cc:845 195 | constexpr pair(const pair&) = default; ///< Copy constructor | ^~~~ 0x766de6 cx_check_missing_mem_inits ../../gcc/cp/constexpr.cc:844 0x77e001 cx_check_missing_mem_inits ../../gcc/cp/constexpr.cc:969 0x77e001 maybe_save_constexpr_fundef(tree_node*) ../../gcc/cp/constexpr.cc:925 0x803fe1 finish_function(bool) ../../gcc/cp/decl.cc:17815 0x882bd3 synthesize_method(tree_node*) ../../gcc/cp/method.cc:1837 0x81dc24 mark_used(tree_node*, int) ../../gcc/cp/decl2.cc:5960 0x72d4d9 build_over_call ../../gcc/cp/call.cc:9850 0x731bef build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**, int) ../../gcc/cp/call.cc:11139 0x733888 build_special_member_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, int) ../../gcc/cp/call.cc:10613 0x7beca6 ocp_convert(tree_node*, tree_node*, int, int, int) ../../gcc/cp/cvt.cc:956 0x8473f3 expand_default_init ../../gcc/cp/init.cc:2127 0x8473f3 expand_aggr_init_1 ../../gcc/cp/init.cc:2313 0x849d18 build_aggr_init(tree_node*, tree_node*, int, int) ../../gcc/cp/init.cc:2033 0x7d910f build_aggr_init_full_exprs ../../gcc/cp/decl.cc:7058 0x7d910f check_initializer ../../gcc/cp/decl.cc:7219 0x8078d6 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ../../gcc/cp/decl.cc:8247 0x996dc4 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/cp/pt.cc:18615 0x992238 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/cp/pt.cc:18423 0x9938d3 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/cp/pt.cc:18780 0x99640c tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/cp/pt.cc:18749