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

            Bug ID: 89571
           Summary: [9 Regression] ICE in nothrow_spec_p, at
                    cp/except.c:1238
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: error-recovery, 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-alpha20190303 snapshot (r269357) ICEs when compiling the following
testcase:

struct z8 {
  constexpr static int qq /* = 0 */;
};

template<typename T>
struct kf {
  kf (const kf &) noexcept (T::qq);
};

struct lk {
  kf<z8> e1;
};

template<typename T>
T &sc ();

struct b6 {
  decltype (lk (sc<lk> ())) zz;
};

% g++-9.0.0-alpha20190303 -c ldifdhlp.cpp
ldifdhlp.cpp:2:24: error: 'constexpr' static data member 'qq' must have an
initializer
    2 |   constexpr static int qq /* = 0 */;
      |                        ^~
ldifdhlp.cpp: In instantiation of 'kf<T>::kf(const kf<T>&) [with T = z8]':
ldifdhlp.cpp:18:26:   required from here
ldifdhlp.cpp:7:3: error: the value of 'z8::qq' is not usable in a constant
expression
    7 |   kf (const kf &) noexcept (T::qq);
      |   ^~
ldifdhlp.cpp:2:24: note: 'z8::qq' was not initialized with a constant
expression
    2 |   constexpr static int qq /* = 0 */;
      |                        ^~
ldifdhlp.cpp:18:26: internal compiler error: in nothrow_spec_p, at
cp/except.c:1238
   18 |   decltype (lk (sc<lk> ())) zz;
      |                          ^
0x602261 nothrow_spec_p(tree_node const*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/except.c:1238
0x88e2f8 set_flags_from_callee(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/call.c:334
0x88e443 build_call_a(tree_node*, int, tree_node**)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/call.c:369
0x89047c build_cxx_call(tree_node*, int, tree_node**, int)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/call.c:9043
0x894579 build_over_call
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/call.c:8586
0x896eff build_new_method_call_1
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/call.c:9775
0x896eff build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/call.c:9850
0x897c69 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/call.c:9274
0x8a289b perform_direct_initialization_if_possible(tree_node*, tree_node*,
bool, int)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/call.c:11136
0xa6b329 build_static_cast_1
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/typeck.c:7178
0xa6f6c7 cp_build_c_cast(tree_node*, tree_node*, int)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/typeck.c:7974
0xa6f6c7 cp_build_c_cast(tree_node*, tree_node*, int)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/typeck.c:7891
0xa7b6bf build_functional_cast(tree_node*, tree_node*, int)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/typeck2.c:2263
0x997aa4 cp_parser_functional_cast
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/parser.c:28288
0x9aa111 cp_parser_postfix_expression
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/parser.c:7098
0x9ac22d cp_parser_decltype_expr
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/parser.c:14530
0x9ac22d cp_parser_decltype
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/parser.c:14626
0x9ac9ef cp_parser_qualifying_entity
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/parser.c:6669
0x9ac9ef cp_parser_nested_name_specifier_opt
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/parser.c:6379
0x9ad353 cp_parser_nested_name_specifier
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190303/work/gcc-9-20190303/gcc/cp/parser.c:6619

Reply via email to