You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consteval int f() { return 42; }
consteval auto g() { return f; }
consteval int h(int (*p)() = g()) { return p(); }
constexpr int r = h(); // OK
and although examples not normative AFAICT this is meant to be valid but clang rejects this although gcc does accept it, see the following godbolt: https://godbolt.org/z/WW7G9q
The text was updated successfully, but these errors were encountered:
Extended Description
The following example is given both in the current C++ draft standard: http://eel.is/c++draft/expr.const#11 and the immediate functions proposal: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r3.html
consteval int f() { return 42; }
consteval auto g() { return f; }
consteval int h(int (*p)() = g()) { return p(); }
constexpr int r = h(); // OK
and although examples not normative AFAICT this is meant to be valid but clang rejects this although gcc does accept it, see the following godbolt: https://godbolt.org/z/WW7G9q
The text was updated successfully, but these errors were encountered: