https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80059
Bug ID: 80059 Summary: [7 Regression] ICE with invalid noexcept for __transaction_atomic Product: gcc Version: 7.0.1 Status: UNCONFIRMED Keywords: ice-on-invalid-code, trans-mem Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org Target Milestone: --- The following invalid code snippet (compiled with -fgnu-tm) triggers an ICE on trunk: ================================================= template<typename> int foo(bool b) { return __transaction_atomic noexcept(b) (0); } void bar() { foo<int>(true); } ================================================= bug.cc: In function 'int foo(bool)': bug.cc:3:45: internal compiler error: unexpected expression 'b' of kind implicit_conv_expr return __transaction_atomic noexcept(b) (0); ^ 0x83f890 cxx_eval_constant_expression ../../gcc/gcc/cp/constexpr.c:4575 0x842ece cxx_eval_outermost_constant_expr ../../gcc/gcc/cp/constexpr.c:4633 0x776f2a build_must_not_throw_expr(tree_node*, tree_node*) ../../gcc/gcc/cp/except.c:274 0x7ac6ff build_transaction_expr(unsigned int, tree_node*, int, tree_node*) ../../gcc/gcc/cp/semantics.c:8747 0x72628f cp_parser_transaction_expression ../../gcc/gcc/cp/parser.c:37871 0x72628f cp_parser_unary_expression ../../gcc/gcc/cp/parser.c:7895 0x726c93 cp_parser_cast_expression ../../gcc/gcc/cp/parser.c:8780 0x7273e7 cp_parser_binary_expression ../../gcc/gcc/cp/parser.c:8881 0x727cb4 cp_parser_assignment_expression ../../gcc/gcc/cp/parser.c:9168 0x72b9c8 cp_parser_expression ../../gcc/gcc/cp/parser.c:9337 0x719f9a cp_parser_jump_statement ../../gcc/gcc/cp/parser.c:12147 0x719f9a cp_parser_statement ../../gcc/gcc/cp/parser.c:10581 0x71a84d cp_parser_statement_seq_opt ../../gcc/gcc/cp/parser.c:11027 0x71a91f cp_parser_compound_statement ../../gcc/gcc/cp/parser.c:10981 0x71aab3 cp_parser_function_body ../../gcc/gcc/cp/parser.c:21428 0x71aab3 cp_parser_ctor_initializer_opt_and_function_body ../../gcc/gcc/cp/parser.c:21466 0x71b331 cp_parser_function_definition_after_declarator ../../gcc/gcc/cp/parser.c:26253 0x71c01d cp_parser_function_definition_from_specifiers_and_declarator ../../gcc/gcc/cp/parser.c:26165 0x71c01d cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:19155 0x71c5ca cp_parser_single_declaration ../../gcc/gcc/cp/parser.c:26711 Please submit a full bug report, [etc.] This is a recent regression introduced between 2017-03-02 and 2017-03-06.