There is a well-known trick to cause a compile-time error in the evaluation of a constexpr function by doing something like this:
constexpr
constexpr int
Instead of using a constexpr function, you should use static_assert. This lets you run an assertion at compile-time that has zero runtime cost.