[Bug c++/80384] New: ICE when deducing noexcept in class template partial specialization

rs2740 at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Apr 10 20:30:00 GMT 2017


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

            Bug ID: 80384
           Summary: ICE when deducing noexcept in class template partial
                    specialization
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rs2740 at gmail dot com
  Target Milestone: ---

https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00665.html "allow[ed]
noexcept(E) to be a deduced context in order to avoid another factor
of two expansion in the partial specializations of is_function."

The following causes an ICE with Wandbox's GCC 7
(https://wandbox.org/permlink/LacBOL6M17og9ZF9):

template<class> struct foo;
template<bool B>
struct foo<int() noexcept(B)> {
    static const bool value = true; 
};

static_assert(!foo<int()>::value);

prog.cc: In instantiation of 'struct foo<int()>':
prog.cc:7:26:   required from here
prog.cc:4:23: internal compiler error: in finish_member_declaration, at
cp/semantics.c:2963
     static const bool value = true;
                       ^~~~~
0x681eb2 finish_member_declaration(tree_node*)
        ../../source/gcc/cp/semantics.c:2963
0x5f1f3a instantiate_class_template_1
        ../../source/gcc/cp/pt.c:10581
0x5f1f3a instantiate_class_template(tree_node*)
        ../../source/gcc/cp/pt.c:10798
0x654435 complete_type(tree_node*)
        ../../source/gcc/cp/typeck.c:133
0x63c032 cp_parser_nested_name_specifier_opt
        ../../source/gcc/cp/parser.c:6153
0x63ee02 cp_parser_simple_type_specifier
        ../../source/gcc/cp/parser.c:16826
0x635d78 cp_parser_postfix_expression
        ../../source/gcc/cp/parser.c:6699
0x63694d cp_parser_unary_expression
        ../../source/gcc/cp/parser.c:8103
0x637703 cp_parser_cast_expression
        ../../source/gcc/cp/parser.c:8781
0x6369b5 cp_parser_unary_expression
        ../../source/gcc/cp/parser.c:8021
0x637703 cp_parser_cast_expression
        ../../source/gcc/cp/parser.c:8781
0x637e77 cp_parser_binary_expression
        ../../source/gcc/cp/parser.c:8882
0x638524 cp_parser_assignment_expression
        ../../source/gcc/cp/parser.c:9169
0x638907 cp_parser_constant_expression
        ../../source/gcc/cp/parser.c:9439
0x638a38 cp_parser_static_assert
        ../../source/gcc/cp/parser.c:13589
0x64afae cp_parser_block_declaration
        ../../source/gcc/cp/parser.c:12599
0x629504 cp_parser_declaration
        ../../source/gcc/cp/parser.c:12500
0x64f25b cp_parser_declaration_seq_opt
        ../../source/gcc/cp/parser.c:12376
0x64f542 cp_parser_translation_unit
        ../../source/gcc/cp/parser.c:4366
0x64f542 c_parse_file()
        ../../source/gcc/cp/parser.c:38427
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.


More information about the Gcc-bugs mailing list