[Bug c++/70513] New: ICE on invalid C++ code on x86_64-linux-gnu: Segmentation fault

su at cs dot ucdavis.edu gcc-bugzilla@gcc.gnu.org
Sat Apr 2 02:54:00 GMT 2016


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

            Bug ID: 70513
           Summary: ICE on invalid C++ code on x86_64-linux-gnu:
                    Segmentation fault
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following causes an ICE when compiled with the current GCC trunk on
x86_64-linux-gnu in both 32-bit and 64-bit modes. 

It seems to also affect at least all GCC versions 4.6.x and later. 


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 6.0.0 20160401 (experimental) [trunk revision 234665] (GCC) 
$ 
$ g++-trunk -c small.cpp
small.cpp:4:29: internal compiler error: Segmentation fault
   enum D::Color { R, G, B } c;
                             ^
0xd5221f crash_signal
        ../../gcc-source-trunk/gcc/toplev.c:335
0x7bba27 tree_class_check
        ../../gcc-source-trunk/gcc/tree.h:3128
0x7bba27 finish_member_declaration(tree_node*)
        ../../gcc-source-trunk/gcc/cp/semantics.c:3025
0x7556dc cp_parser_member_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:22635
0x72f8e0 cp_parser_member_specification_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:22122
0x72f8e0 cp_parser_class_specifier_1
        ../../gcc-source-trunk/gcc/cp/parser.c:21314
0x72f8e0 cp_parser_class_specifier
        ../../gcc-source-trunk/gcc/cp/parser.c:21550
0x72f8e0 cp_parser_type_specifier
        ../../gcc-source-trunk/gcc/cp/parser.c:15834
0x749ea3 cp_parser_decl_specifier_seq
        ../../gcc-source-trunk/gcc/cp/parser.c:12758
0x754225 cp_parser_single_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:25717
0x75459c cp_parser_template_declaration_after_parameters
        ../../gcc-source-trunk/gcc/cp/parser.c:25416
0x754fa8 cp_parser_explicit_template_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:25644
0x754fa8 cp_parser_template_declaration_after_export
        ../../gcc-source-trunk/gcc/cp/parser.c:25662
0x75c389 cp_parser_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12094
0x75ad54 cp_parser_declaration_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:12024
0x75b088 cp_parser_translation_unit
        ../../gcc-source-trunk/gcc/cp/parser.c:4323
0x75b088 c_parse_file()
        ../../gcc-source-trunk/gcc/cp/parser.c:37408
0x8bab42 c_common_parse_file()
        ../../gcc-source-trunk/gcc/c-family/c-opts.c:1064
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


---------------------------------


template < typename T > 
class D
{
  enum D::Color { R, G, B } c;
};


More information about the Gcc-bugs mailing list