https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84854
Bug ID: 84854 Summary: [7/8 Regression] ICE: unexpected expression in cxx_eval_constant_expression, at cp/constexpr.c:4774 Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Changed between 20160807 and 20160814 : $ cat z1.cc template <typename> void a() { if constexpr(a) { }; } $ gcc-8-20180311 -c z1.cc z1.cc: In function 'void a()': z1.cc:2:6: warning: 'if constexpr' only available with -std=c++17 or -std=gnu++17 if constexpr(a) { }; ^~~~~~~~~ z1.cc:2:17: internal compiler error: unexpected expression 'a' of kind overload if constexpr(a) { }; ^ 0x6a506d cxx_eval_constant_expression ../../gcc/cp/constexpr.c:4774 0x6a67fc cxx_eval_outermost_constant_expr ../../gcc/cp/constexpr.c:4833 0x793945 finish_if_stmt_cond(tree_node*, tree_node*) ../../gcc/cp/semantics.c:739 0x737e93 cp_parser_selection_statement ../../gcc/cp/parser.c:11393 0x737e93 cp_parser_statement ../../gcc/cp/parser.c:10816 0x7387a7 cp_parser_statement_seq_opt ../../gcc/cp/parser.c:11274 0x73887f cp_parser_compound_statement ../../gcc/cp/parser.c:11228 0x74a37e cp_parser_function_body ../../gcc/cp/parser.c:21778 0x74a37e cp_parser_ctor_initializer_opt_and_function_body ../../gcc/cp/parser.c:21813 0x74ab40 cp_parser_function_definition_after_declarator ../../gcc/cp/parser.c:26828 0x74dce6 cp_parser_function_definition_from_specifiers_and_declarator ../../gcc/cp/parser.c:26745 0x74dce6 cp_parser_init_declarator ../../gcc/cp/parser.c:19502 0x74e0cf cp_parser_single_declaration ../../gcc/cp/parser.c:27284 0x74e1bc cp_parser_template_declaration_after_parameters ../../gcc/cp/parser.c:26886 0x74e82c cp_parser_explicit_template_declaration ../../gcc/cp/parser.c:27124 0x74e82c cp_parser_template_declaration_after_export ../../gcc/cp/parser.c:27142 0x757929 cp_parser_declaration ../../gcc/cp/parser.c:12729 0x756356 cp_parser_declaration_seq_opt ../../gcc/cp/parser.c:12656 0x75665f cp_parser_translation_unit ../../gcc/cp/parser.c:4561 0x75665f c_parse_file() ../../gcc/cp/parser.c:39005