constexpr-function

What does [decl.constexpr].5 mean exactly?

谁说胖子不能爱 提交于 2020-06-16 02:26:30
问题 The standard on constexpr functions states under point 5 of [decl.constexpr]: For a non-template, non-defaulted constexpr function or a non-template, non-defaulted, non-inheriting constexpr constructor, if no argument values exist such that an invocation of the function or constructor could be an evaluated subexpression of a core constant expression (5.19), the program is ill-formed; no diagnostic required. It goes on to give the following example for this: constexpr int f(bool b){ return b ?