https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84940
Bug ID: 84940
Summary: internal compiler error: in build_value_init_noctor,
at cp/init.c:465
Product: gcc
Version: 8.0.1
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vegard.nossum at gmail dot com
CC: webrown.cpp at gmail dot com
Target Milestone: ---
Input:
int b;
void c() {
struct {
} a[__builtin_constant_p(0)][b](-a[0])
}
Output:
$ cc1plus
void c()
<stdin>:4:39: error: wrong type argument to unary minus
<stdin>:4:39: internal compiler error: in build_value_init_noctor, at
cp/init.c:465
0xcf8133 build_value_init_noctor(tree_node*, int)
/home/vegard/git/gcc/gcc/cp/init.c:465
0xcf8474 build_value_init(tree_node*, int)
/home/vegard/git/gcc/gcc/cp/init.c:378
0xa429f6 cxx_eval_array_reference
/home/vegard/git/gcc/gcc/cp/constexpr.c:2472
0xa2f3d0 cxx_eval_constant_expression
/home/vegard/git/gcc/gcc/cp/constexpr.c:4475
0xa4996a cxx_eval_outermost_constant_expr
/home/vegard/git/gcc/gcc/cp/constexpr.c:4832
0xa57256 maybe_constant_value(tree_node*, tree_node*)
/home/vegard/git/gcc/gcc/cp/constexpr.c:5049
0xab6bea cp_fully_fold(tree_node*)
/home/vegard/git/gcc/gcc/cp/cp-gimplify.c:2041
0x1273a47 finish_unary_op_expr(unsigned int, tree_code, cp_expr, int)
/home/vegard/git/gcc/gcc/cp/semantics.c:2679
0xf2a14f cp_parser_unary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:8303
0xebfeca cp_parser_cast_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9090
0xec24f6 cp_parser_binary_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9191
0xec62ca cp_parser_assignment_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9486
0xecc0a3 cp_parser_constant_expression
/home/vegard/git/gcc/gcc/cp/parser.c:9770
0xed376b cp_parser_parenthesized_expression_list
/home/vegard/git/gcc/gcc/cp/parser.c:7758
0xedc2bc cp_parser_initializer
/home/vegard/git/gcc/gcc/cp/parser.c:21864
0xfa0f3d cp_parser_init_declarator
/home/vegard/git/gcc/gcc/cp/parser.c:19677
0xfa57a7 cp_parser_simple_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:13065
0xfab998 cp_parser_block_declaration
/home/vegard/git/gcc/gcc/cp/parser.c:12883
0xfade64 cp_parser_declaration_statement
/home/vegard/git/gcc/gcc/cp/parser.c:12476
0xefab2b cp_parser_statement
/home/vegard/git/gcc/gcc/cp/parser.c:10925
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.
Version:
GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)
Possibly related to bug #80812?