[Bug c++/83186] New: [8 regression] internal compiler error: in build_address, at cp/typeck.c:5667

skpgkp1 at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Nov 27 19:13:00 GMT 2017


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

            Bug ID: 83186
           Summary: [8 regression] internal compiler error: in
                    build_address, at cp/typeck.c:5667
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: skpgkp1 at gmail dot com
  Target Milestone: ---

It appear with webtoolkit application(wt) build with GCC8. It works fine with
GCC7.2.1. Following are steps to reproduce.

$ cat WDate.i.C
class a {
  operator unsigned();
};
template <class> void b() { static_cast<unsigned>(a{}); }

$g++ --version
g++ (GCC) 8.0.0 20171127 (experimental)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++  -O0  -o WDate.i.C.o -c WDate.i.C
WDate.i.C: In function ‘void b()’:
WDate.i.C:4:54: internal compiler error: in build_address, at cp/typeck.c:5667
 template <class> void b() { static_cast<unsigned>(a{}); }
                                                      ^
0x63fed3 build_address(tree_node*)
        ../../gcc-main.3O1J/gcc/cp/typeck.c:5667
0x8e4ce5 add_function_candidate
        ../../gcc-main.3O1J/gcc/cp/call.c:2158
0x8e5eff add_candidates
        ../../gcc-main.3O1J/gcc/cp/call.c:5514
0x8e207e add_candidates
        ../../gcc-main.3O1J/gcc/cp/call.c:5425
0x8e207e build_user_type_conversion_1
        ../../gcc-main.3O1J/gcc/cp/call.c:3841
0x8e34a9 implicit_conversion
        ../../gcc-main.3O1J/gcc/cp/call.c:1889
0x8e8295 perform_direct_initialization_if_possible(tree_node*, tree_node*,
bool, int)
        ../../gcc-main.3O1J/gcc/cp/call.c:10635
0xa9ed67 build_static_cast_1
        ../../gcc-main.3O1J/gcc/cp/typeck.c:6959
0xa9f9a4 build_static_cast(tree_node*, tree_node*, int)
        ../../gcc-main.3O1J/gcc/cp/typeck.c:7141
0x9eebb0 cp_parser_postfix_expression
        ../../gcc-main.3O1J/gcc/cp/parser.c:6698
0x9f10fa cp_parser_unary_expression
        ../../gcc-main.3O1J/gcc/cp/parser.c:8365
0x9d295f cp_parser_cast_expression
        ../../gcc-main.3O1J/gcc/cp/parser.c:9133
0x9d3147 cp_parser_binary_expression
        ../../gcc-main.3O1J/gcc/cp/parser.c:9234
0x9d4ad4 cp_parser_assignment_expression
        ../../gcc-main.3O1J/gcc/cp/parser.c:9521
0x9d51ba cp_parser_expression
        ../../gcc-main.3O1J/gcc/cp/parser.c:9690
0x9d6e98 cp_parser_expression_statement
        ../../gcc-main.3O1J/gcc/cp/parser.c:11208
0x9dcb16 cp_parser_statement
        ../../gcc-main.3O1J/gcc/cp/parser.c:11024
0x9dda50 cp_parser_statement_seq_opt
        ../../gcc-main.3O1J/gcc/cp/parser.c:11351
0x9ddb27 cp_parser_compound_statement
        ../../gcc-main.3O1J/gcc/cp/parser.c:11305
0x9f49f0 cp_parser_function_body
        ../../gcc-main.3O1J/gcc/cp/parser.c:21841
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

## Work fine with GCC 7.

$g++ --version
g++ (GCC) 7.2.1 20171127
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++  -O0  -o WDate.i.C.o -c WDate.i.C
$echo $?
0


More information about the Gcc-bugs mailing list