[Bug c++/79435] New: ICE on invalid C++ code (with member access into an incomplete type) on x86_64-linux-gnu: Segmentation fault

su at cs dot ucdavis.edu gcc-bugzilla@gcc.gnu.org
Wed Feb 8 21:38:00 GMT 2017


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

            Bug ID: 79435
           Summary: ICE on invalid C++ code (with member access into an
                    incomplete type) on x86_64-linux-gnu: Segmentation
                    fault
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

It should be a recent regression. 

$ 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/7.0.1/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 7.0.1 20170208 (experimental) [trunk revision 245266] (GCC)
$
$ g++-trunk -c -w small.cpp
small.cpp:3:28: internal compiler error: Segmentation fault
 template < int > int f = a.x;
                            ^
0xe1439f crash_signal
        ../../gcc-source-trunk/gcc/toplev.c:333
0x6e2a88 type_dependent_expression_p(tree_node*)
        ../../gcc-source-trunk/gcc/cp/pt.c:23832
0x8dca90 potential_constant_expression_1
        ../../gcc-source-trunk/gcc/cp/constexpr.c:5159
0x7bcd94 cp_parser_constant_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9468
0x7bd4f4 cp_parser_initializer_clause
        ../../gcc-source-trunk/gcc/cp/parser.c:21595
0x7bee8b cp_parser_initializer
        ../../gcc-source-trunk/gcc/cp/parser.c:21533
0x7ce618 cp_parser_init_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:19352
0x7d59c1 cp_parser_single_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:26720
0x7d5afc cp_parser_template_declaration_after_parameters
        ../../gcc-source-trunk/gcc/cp/parser.c:26321
0x7d6521 cp_parser_explicit_template_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:26553
0x7d6521 cp_parser_template_declaration_after_export
        ../../gcc-source-trunk/gcc/cp/parser.c:26571
0x7d6ad9 cp_parser_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12464
0x7d6de4 cp_parser_declaration_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:12391
0x7d7128 cp_parser_translation_unit
        ../../gcc-source-trunk/gcc/cp/parser.c:4366
0x7d7128 c_parse_file()
        ../../gcc-source-trunk/gcc/cp/parser.c:38406
0x93f2e2 c_common_parse_file()
        ../../gcc-source-trunk/gcc/c-family/c-opts.c:1107
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.
$


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


struct A;
extern A a;
template < int > int f = a.x;


More information about the Gcc-bugs mailing list