https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83273
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |jason at gcc dot gnu.org, | |nathan at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- tree finish_if_stmt_cond (tree cond, tree if_stmt) { cond = maybe_convert_cond (cond); if (IF_STMT_CONSTEXPR_P (if_stmt) && is_constant_expression (cond) && !value_dependent_expression_p (cond)) { cond = instantiate_non_dependent_expr (cond); cond = cxx_constant_value (cond, NULL_TREE); } So, if is_constant_expression is true, we do the right thing. There is just no diagnostics if cond fails the is_constant_expression check and isn't value dependent. We actually treat that if constexpr like normal if, with both then and else evaluated.