https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88987

            Bug ID: 88987
           Summary: [9 Regression] ICE: unexpected expression '(bool)sm'
                    of kind implicit_conv_expr
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-9.0.0-alpha20190120 snapshot (r268107) ICEs when compiling the following
testcase:

int sm;

template <typename T> T
pk () noexcept (sm)
{
  return 0;
}

% g++-9.0.0-alpha20190120 -c b6bdwqbi.cpp
b6bdwqbi.cpp:4:17: error: the value of 'sm' is not usable in a constant
expression
    4 | pk () noexcept (sm)
      |                 ^~
b6bdwqbi.cpp:1:5: note: 'int sm' is not const
    1 | int sm;
      |     ^~
b6bdwqbi.cpp:4:19: internal compiler error: unexpected expression '(bool)sm' of
kind implicit_conv_expr
    4 | pk () noexcept (sm)
      |                   ^
0x8cf4fb cxx_eval_constant_expression
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/constexpr.c:4983
0x8d2672 cxx_eval_outermost_constant_expr
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/constexpr.c:5095
0x93ed98 build_noexcept_spec(tree_node*, int)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/except.c:1292
0x9b32c5 cp_parser_exception_specification_opt
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/parser.c:25149
0x9acfca cp_parser_direct_declarator
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/parser.c:20751
0x9acfca cp_parser_declarator
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/parser.c:20582
0x9bb4ff cp_parser_init_declarator
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/parser.c:20092
0x9bf6c4 cp_parser_single_declaration
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/parser.c:28096
0x9bf82e cp_parser_template_declaration_after_parameters
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/parser.c:27688
0x9c019e cp_parser_explicit_template_declaration
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/parser.c:27934
0x9c019e cp_parser_template_declaration_after_export
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/parser.c:27953
0x9c2d39 cp_parser_declaration
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/parser.c:13122
0x9c33a0 cp_parser_translation_unit
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/parser.c:4698
0x9c33a0 c_parse_file()
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/cp/parser.c:41003
0xaccdab c_common_parse_file()
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190120/work/gcc-9-20190120/gcc/c-family/c-opts.c:1155

Reply via email to