[Bug c++/62115] New: [4.10 Regression] ICE with invalid default argument

reichelt at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Aug 12 23:16:00 GMT 2014


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

            Bug ID: 62115
           Summary: [4.10 Regression] ICE with invalid default argument
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
                CC: jason at gcc dot gnu.org, paolo at gcc dot gnu.org

The following invalid code snippet triggers an ICE on trunk:

========================
struct A {};
struct B : A {};

struct C
{
  C(A& a = B()) {}
};

C c;
========================

bug.cc:6:14: internal compiler error: in convert_like_real, at cp/call.c:6382
   C(A& a = B()) {}
              ^
0x5720b8 convert_like_real
        ../../gcc/gcc/cp/call.c:6382
0x57240f perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
        ../../gcc/gcc/cp/call.c:9289
0x58fb4d check_default_argument(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:11092
0x682547 cp_parser_late_parse_one_default_arg
        ../../gcc/gcc/cp/parser.c:23926
0x671b8b cp_parser_late_parsing_default_args
        ../../gcc/gcc/cp/parser.c:24016
0x671b8b cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:19700
0x6741d0 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19771
0x6741d0 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:14522
0x68c994 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:11763
0x692639 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11353
0x676403 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:11302
0x69cd25 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:11199
0x69b9d8 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:11085
0x69d273 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4061
0x69d273 c_parse_file()
        ../../gcc/gcc/cp/parser.c:31951
0x7c1442 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1115
Please submit a full bug report, [etc.]

The regression was introduced between 2014-05-13 and 2014-05-20.
Paolo, Jason, this might be fallout from your patches on 2014-05-14.



More information about the Gcc-bugs mailing list