public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60224] New: [4.7/4.8/4.9 Regression] ICE using invalid initializer for array
@ 2014-02-16 17:19 reichelt at gcc dot gnu.org
  2014-02-17 12:33 ` [Bug c++/60224] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-02-16 17:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60224
           Summary: [4.7/4.8/4.9 Regression] ICE using invalid initializer
                    for array
           Product: gcc
           Version: 4.9.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

The following invalid code snippet triggers an ICE since GCC 3.3 (with the
exception of GCC 4.1.2):

==========================================
struct A {};

void foo()
{
  bool b[] = (int (A::*)())0;
}
==========================================

bug.cc: In function 'void foo()':
bug.cc:5:28: internal compiler error: unexpected expression 'int
(A::*)()::__pfn' of kind field_decl
   bool b[] = (int (A::*)())0;
                            ^
0x73e08f cxx_eval_constant_expression
        ../../gcc/gcc/cp/semantics.c:9787
0x7410d5 cxx_eval_outermost_constant_expr
        ../../gcc/gcc/cp/semantics.c:9807
0x5be3ba check_array_designated_initializer
        ../../gcc/gcc/cp/decl.c:4841
0x5c6f3a maybe_deduce_size_from_array_init
        ../../gcc/gcc/cp/decl.c:4889
0x5c716a check_initializer
        ../../gcc/gcc/cp/decl.c:5714
0x5d99fc cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:6396
0x6c81bd cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16815
0x6c9979 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11205
0x6acc63 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:11086
0x6add81 cp_parser_declaration_statement
        ../../gcc/gcc/cp/parser.c:10733
0x6ae3cb cp_parser_statement
        ../../gcc/gcc/cp/parser.c:9467
0x6af1b9 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:9745
0x6af326 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:9699
0x6c34fb cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:18641
0x6c34fb cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:18677
0x6c7842 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:22792
0x6c86e1 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:22704
0x6c86e1 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16585
0x6c9979 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11205
0x6acc63 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:11086
Please submit a full bug report, [etc.]

GCC 3.2.x and GCC 4.1.2 work fine, i.e. they produce a decent error message
without crashing.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-02-21 15:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-16 17:19 [Bug c++/60224] New: [4.7/4.8/4.9 Regression] ICE using invalid initializer for array reichelt at gcc dot gnu.org
2014-02-17 12:33 ` [Bug c++/60224] " rguenth at gcc dot gnu.org
2014-02-17 16:18 ` jakub at gcc dot gnu.org
2014-02-21  5:52 ` jason at gcc dot gnu.org
2014-02-21 14:57 ` jason at gcc dot gnu.org
2014-02-21 15:55 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).