https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67371
--- Comment #4 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- The fix might be as simple as: diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 1eacb8be9a44..7016b347a79c 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -4324,7 +4324,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, case VEC_NEW_EXPR: case DELETE_EXPR: case VEC_DELETE_EXPR: - case THROW_EXPR: case OMP_ATOMIC: case OMP_ATOMIC_READ: case OMP_ATOMIC_CAPTURE_OLD: @@ -4629,6 +4628,9 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, /* We can see these in statement-expressions. */ return true; + case THROW_EXPR: + return true; + default: if (objc_is_property_ref (t)) return false;