https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94751
Bug ID: 94751 Summary: [9/10] ICE on invalid code in maybe_instantiate_noexcept Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: s...@li-snyder.org Target Milestone: --- hi - gcc version: gcc version 10.0.1 20200329 (experimental) (GCC) ICEs on the following (invalid) input: -- x.cc ----------------------------------------------------- struct Algorithm { Algorithm( float ); }; template <class BASE> struct ToolWithConstants : public Algorithm { using Algorithm::Algorithm; struct Constant { Constant (int name); }; Constant c { "order" }; }; class unique_ptr {}; unique_ptr make() { return unique_ptr (new ToolWithConstants<Algorithm> (10.5)); } ------------------------------------------------------------ like this: [sss@karma rootaccess]$ g++ -c x.cc x.cc: In function ‘unique_ptr make()’: x.cc:25:60: internal compiler error: Segmentation fault 25 | return unique_ptr (new ToolWithConstants<Algorithm> (10.5)); | ^ 0xc4fe4f crash_signal /home/sss/gcc/gcc/gcc/toplev.c:328 0x7f4d24bf8ebf ??? /usr/src/debug/glibc-2.29-51-g845278f2c6/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0 0x759eff maybe_instantiate_noexcept(tree_node*, int) /home/sss/gcc/gcc/gcc/cp/pt.c:25032 0x6b8388 mark_used(tree_node*, int) /home/sss/gcc/gcc/gcc/cp/decl2.c:5512 0x644892 build_over_call /home/sss/gcc/gcc/gcc/cp/call.c:9048 0x646ade build_new_method_call_1 /home/sss/gcc/gcc/gcc/cp/call.c:10338 0x647796 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**, int) /home/sss/gcc/gcc/gcc/cp/call.c:10413 0x647796 build_special_member_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, int) /home/sss/gcc/gcc/gcc/cp/call.c:9814 0x6cec5f build_new_1 /home/sss/gcc/gcc/gcc/cp/init.c:3588 0x6cf9f8 build_new(unsigned int, vec<tree_node*, va_gc, vl_embed>**, tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int, int) /home/sss/gcc/gcc/gcc/cp/init.c:3905 0x729a37 cp_parser_new_expression /home/sss/gcc/gcc/gcc/cp/parser.c:8825 0x72a057 cp_parser_unary_expression /home/sss/gcc/gcc/gcc/cp/parser.c:8418 0x706b1a cp_parser_binary_expression /home/sss/gcc/gcc/gcc/cp/parser.c:9554 0x7081ce cp_parser_assignment_expression /home/sss/gcc/gcc/gcc/cp/parser.c:9859 0x70a668 cp_parser_parenthesized_expression_list /home/sss/gcc/gcc/gcc/cp/parser.c:7981 0x70ada2 cp_parser_functional_cast /home/sss/gcc/gcc/gcc/cp/parser.c:29572 0x721f24 cp_parser_postfix_expression /home/sss/gcc/gcc/gcc/cp/parser.c:7180 0x706b1a cp_parser_binary_expression /home/sss/gcc/gcc/gcc/cp/parser.c:9554 0x7081ce cp_parser_assignment_expression /home/sss/gcc/gcc/gcc/cp/parser.c:9859 0x7084e2 cp_parser_expression /home/sss/gcc/gcc/gcc/cp/parser.c:10027 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. A crash is also observed with a 20200424 version as well as gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC) thanks, sss