Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pointer to consteval function not allowed in default argument to consteval function #47058

Closed
llvmbot opened this issue Oct 2, 2020 · 2 comments
Labels
bugzilla Issues migrated from bugzilla c++20 duplicate Resolved as duplicate

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 2, 2020

Bugzilla Link 47714
Resolution DUPLICATE
Resolved on Oct 21, 2021 06:09
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @AaronBallman,@efriedma-quic,@zygoloid,@synopsys-sig-compiler-frontends

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

@AaronBallman
Copy link
Collaborator

*** This bug has been marked as a duplicate of bug llvm/llvm-bugzilla-archive#48886 ***

@andreasfertig
Copy link
Contributor

mentioned in issue llvm/llvm-bugzilla-archive#48886

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++20 duplicate Resolved as duplicate
Projects
None yet
Development

No branches or pull requests

3 participants