This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/60393] New: [c++1y] ICE with with invalid functions with auto parameters


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60393

            Bug ID: 60393
           Summary: [c++1y] ICE with with invalid functions with auto
                    parameters
           Product: gcc
           Version: 4.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: reichelt at gcc dot gnu.org
                CC: abutcher at gcc dot gnu.org

The following invalid code snippets (compiled with "-std=c++1y") trigger
an ICE on trunk:

==============================
void (*f)(auto) + 0;

struct A
{
  int i;
};
==============================

bug.cc:1:17: error: expected initializer before '+' token
 void (*f)(auto) + 0;
                 ^
bug.cc:5:7: error: data member 'i' cannot be a member template
   int i;
       ^
bug.cc:5:7: internal compiler error: in poplevel, at cp/decl.c:568
0x5c54a3 poplevel(int, int, int)
        ../../gcc/gcc/cp/decl.c:568
0x5feba8 end_template_decl()
        ../../gcc/gcc/cp/pt.c:3807
0x6a3941 finish_fully_implicit_template
        ../../gcc/gcc/cp/parser.c:32052
0x6acafc cp_parser_member_declaration
        ../../gcc/gcc/cp/parser.c:20487
0x6afa74 cp_parser_member_specification_opt
        ../../gcc/gcc/cp/parser.c:20034
0x6afa74 cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:19268
0x6afa74 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19495
0x6afa74 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:14305
0x6c8f70 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:11547
0x6cfb49 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11137
0x6b2ff3 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:11086
0x6da2b2 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10983
0x6d8fa8 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10869
0x6da85a cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4014
0x6da85a c_parse_file()
        ../../gcc/gcc/cp/parser.c:31595
0x7f9f53 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]

==============================
struct A
{
  void foo();
};

void A::foo(auto) {}

struct B
{
  int i;
};
==============================

bug.cc:6:6: error: prototype for 'void A::foo(auto:1)' does not match any in
class 'A'
 void A::foo(auto) {}
      ^
bug.cc:3:8: error: candidate is: void A::foo()
   void foo();
        ^
bug.cc:10:7: error: data member 'i' cannot be a member template
   int i;
       ^
bug.cc:10:7: internal compiler error: in poplevel, at cp/decl.c:568
0x5c54a3 poplevel(int, int, int)
        ../../gcc/gcc/cp/decl.c:568
0x5feba8 end_template_decl()
        ../../gcc/gcc/cp/pt.c:3807
0x6a3941 finish_fully_implicit_template
        ../../gcc/gcc/cp/parser.c:32052
0x6acafc cp_parser_member_declaration
        ../../gcc/gcc/cp/parser.c:20487
0x6afa74 cp_parser_member_specification_opt
        ../../gcc/gcc/cp/parser.c:20034
0x6afa74 cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:19268
0x6afa74 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19495
0x6afa74 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:14305
0x6c8f70 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:11547
0x6cfb49 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11137
0x6b2ff3 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:11086
0x6da2b2 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10983
0x6d8fa8 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10869
0x6da85a cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4014
0x6da85a c_parse_file()
        ../../gcc/gcc/cp/parser.c:31595
0x7f9f53 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]

Adam, these look similar to PR60377 you just fixed.
Could you please have a look?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]