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

            Bug ID: 80991
           Summary: ICE with __is_trivially_constructible in template
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE since GCC 5.1.0:

================================================================
template<bool> void foo()
{
  static_assert(__is_trivially_constructible(int, int), "");
}

void bar()
{
  foo<true>();
}
================================================================

bug.cc: In function 'void foo()':
bug.cc:3:60: internal compiler error: tree check: expected class 'type', have
'exceptional' (tree_list) in dependent_type_p, at cp/pt.c:23555
   static_assert(__is_trivially_constructible(int, int), "");
                                                            ^
0x1029257 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/gcc/tree.c:9909
0x78cebf tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        ../../gcc/gcc/tree.h:3206
0x78cebf dependent_type_p(tree_node*)
        ../../gcc/gcc/cp/pt.c:23555
0x805787 finish_static_assert(tree_node*, tree_node*, unsigned int, bool)
        ../../gcc/gcc/cp/semantics.c:8823
0x7577d0 cp_parser_static_assert
        ../../gcc/gcc/cp/parser.c:13651
0x76f9b6 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:12622
0x770199 cp_parser_declaration_statement
        ../../gcc/gcc/cp/parser.c:12235
0x744ef3 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:10722
0x745fbd cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:11054
0x74608f cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:11008
0x760853 cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:21445
0x760853 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:21483
0x765e61 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:26290
0x74f8bd cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:26202
0x74f8bd cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:19168
0x74fe3a cp_parser_single_declaration
        ../../gcc/gcc/cp/parser.c:26748
0x76910c cp_parser_template_declaration_after_parameters
        ../../gcc/gcc/cp/parser.c:26352
0x768d94 cp_parser_explicit_template_declaration
        ../../gcc/gcc/cp/parser.c:26587
0x768d94 cp_parser_template_declaration_after_export
        ../../gcc/gcc/cp/parser.c:26606
0x741c79 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:12472
Please submit a full bug report, [etc.]

Reply via email to