https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84984
Bug ID: 84984 Summary: internal compiler error: in build2, at tree.c:4686 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 oracle dot com CC: webrown.cpp at gmail dot com Target Milestone: --- Input: int a; b(decltype(&a - __builtin_constant_p(0 ?: throw 0) ?: auto)); Output: $ cc1plus <stdin>:2:60: error: invalid use of 'void' <stdin>:2:33: internal compiler error: in build2, at tree.c:4686 0x4025a2b build2(tree_code, tree_node*, tree_node*, tree_node*) /home/vegard/git/gcc/gcc/tree.c:4685 0x1f9ab52 build2_loc /home/vegard/git/gcc/gcc/tree.h:4112 0x1f9ab52 fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*, tree_node*) /home/vegard/git/gcc/gcc/fold-const.c:12330 0x1f9ab52 fold_build_pointer_plus_loc(unsigned int, tree_node*, tree_node*) /home/vegard/git/gcc/gcc/fold-const.c:14542 0x10f1df4 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) /home/vegard/git/gcc/gcc/cp/pt.c:17557 0xa5796a fold_non_dependent_expr(tree_node*) /home/vegard/git/gcc/gcc/cp/constexpr.c:5102 0x105112f build_non_dependent_expr(tree_node*) /home/vegard/git/gcc/gcc/cp/pt.c:25305 0x13959af build_x_conditional_expr(unsigned int, tree_node*, tree_node*, tree_node*, int) /home/vegard/git/gcc/gcc/cp/typeck.c:6559 0xecbaa8 cp_parser_question_colon_clause /home/vegard/git/gcc/gcc/cp/parser.c:9456 0xec682e cp_parser_assignment_expression /home/vegard/git/gcc/gcc/cp/parser.c:9492 0xec87ea cp_parser_expression /home/vegard/git/gcc/gcc/cp/parser.c:9655 0xf3478f cp_parser_primary_expression /home/vegard/git/gcc/gcc/cp/parser.c:5206 0xf7698b cp_parser_postfix_expression /home/vegard/git/gcc/gcc/cp/parser.c:7030 0xf7ae79 cp_parser_decltype_expr /home/vegard/git/gcc/gcc/cp/parser.c:14037 0xf7ae79 cp_parser_decltype /home/vegard/git/gcc/gcc/cp/parser.c:14135 0xf2db37 cp_parser_simple_type_specifier /home/vegard/git/gcc/gcc/cp/parser.c:17065 0xf22abd cp_parser_type_specifier /home/vegard/git/gcc/gcc/cp/parser.c:16852 0xf8858a cp_parser_decl_specifier_seq /home/vegard/git/gcc/gcc/cp/parser.c:13629 0xfb6b9d cp_parser_parameter_declaration /home/vegard/git/gcc/gcc/cp/parser.c:21506 0xfb94ea cp_parser_parameter_declaration_list /home/vegard/git/gcc/gcc/cp/parser.c:21318 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)