@@ -8147,6 +8147,10 @@ this statement was preceded by the GNU keyword __extension__.
81478147 if (current_rp -> is_declared_constexpr || current_rp -> is_consteval ) {
81488148 /* Report an error if the statement is not one that is allowed in a
81498149 constexpr function or constexpr constructor. */
8150+ an_error_code err_code =
8151+ special_kind_is (current_rp , sfk_constructor ) ?
8152+ ec_invalid_statement_in_constexpr_constructor :
8153+ ec_invalid_statement_in_constexpr_function ;
81508154 if (current_rp -> is_prototype_instantiation &&
81518155 in_constexpr_body_sev == es_error && !strict_ansi_mode ) {
81528156 /* In uninstantiated templates common practice is to either not
@@ -8157,13 +8161,13 @@ this statement was preceded by the GNU keyword __extension__.
81578161 current_rp -> is_template_function ) {
81588162 in_constexpr_body_sev = es_warning ;
81598163 } /* if */
8160- pos_diagnostic (in_constexpr_body_sev ,
8161- special_kind_is (current_rp , sfk_constructor ) ?
8162- ec_invalid_statement_in_constexpr_constructor :
8163- ec_invalid_statement_in_constexpr_function ,
8164- & start_pos );
8164+ pos_diagnostic (in_constexpr_body_sev , err_code , & start_pos );
8165+ if (is_effective_error (err_code , in_constexpr_body_sev , & start_pos )) {
8166+ scope_stack [depth_innermost_function_scope ].constexpr_ruled_out = TRUE;
8167+ } /* if */
8168+ } else {
8169+ scope_stack [depth_innermost_function_scope ].constexpr_ruled_out = TRUE;
81658170 } /* if */
8166- scope_stack [depth_innermost_function_scope ].constexpr_ruled_out = TRUE;
81678171 } /* if */
81688172 /* Loop if we just got a label and not an actual statement. */
81698173 if (get_another_statement ) {
0 commit comments