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

            Bug ID: 72811
           Summary: ICE on invalid C++ code on x86_64-linux-gnu (internal
                    compiler error: in instantiate_type,
                    perform_implicit_conversion_flags)
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chengniansun at gmail dot com
  Target Milestone: ---

$ 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.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 7.0.0 20160805 (experimental) [trunk revision 239162] (GCC)
$
$ g++-trunk small.C
small.C:2:15: internal compiler error: in instantiate_type, at cp/class.c:8248
 } a = C::C ?: 0;
               ^
0x750d0e instantiate_type(tree_node*, tree_node*, int)
        ../../gcc-source-trunk/gcc/cp/class.c:8245
0x681bb4 perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
        ../../gcc-source-trunk/gcc/cp/call.c:9748
0x69067f build_conditional_expr_1
        ../../gcc-source-trunk/gcc/cp/call.c:4806
0x69244c build_conditional_expr(unsigned int, tree_node*, tree_node*,
tree_node*, int)
        ../../gcc-source-trunk/gcc/cp/call.c:5231
0x7d5bd0 build_x_conditional_expr(unsigned int, tree_node*, tree_node*,
tree_node*, int)
        ../../gcc-source-trunk/gcc/cp/typeck.c:6279
0x7abd53 cp_parser_question_colon_clause
        ../../gcc-source-trunk/gcc/cp/parser.c:9047
0x7abd53 cp_parser_assignment_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9083
0x7abf9a cp_parser_constant_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9347
0x7ac754 cp_parser_initializer_clause
        ../../gcc-source-trunk/gcc/cp/parser.c:20885
0x7adf7b cp_parser_initializer
        ../../gcc-source-trunk/gcc/cp/parser.c:20825
0x7bfa8d cp_parser_init_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:18690
0x7c0631 cp_parser_simple_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12415
0x7c095a cp_parser_block_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12283
0x7ca294 cp_parser_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12180
0x7c8b76 cp_parser_declaration_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:12059
0x7c8eac cp_parser_translation_unit
        ../../gcc-source-trunk/gcc/cp/parser.c:4350
0x7c8eac c_parse_file()
        ../../gcc-source-trunk/gcc/cp/parser.c:37549
0x92cc32 c_common_parse_file()
        ../../gcc-source-trunk/gcc/c-family/c-opts.c:1070
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.
$ cat small.C
struct C {
} a = C::C ?: 0;
$

Reply via email to