[clang] [clang] Handle consteval constructors with default initialization. (PR #144970)
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 30 13:18:20 PDT 2025
efriedma-quic wrote:
ActOnCXXExitDeclInitializer does three things:
- Some scope handling which isn't relevant in this context.
- Does some special handling for variables, to compute whether the variable's initializer is manifestly constant-evaluated.
- Calls PopExpressionEvaluationContext
The special handling for variables is specifically relevant for variables... I don't see why we'd need it anywhere else? Except, hmm... I guess we need the same handling if we're instantiating a template, like:
```
struct B {
const void* p;
consteval B() : p{this} {}
};
template<typename T> T x{};
B* y = &x<B>;
```
But I can't think of anything else.
Any suggestions for how to refactor?
https://github.com/llvm/llvm-project/pull/144970
More information about the cfe-commits
mailing list