[clang] Immediate invocations in constexpr initailizers are evaluated twice #117321
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
consteval
C++20 consteval
constexpr
Anything related to constant evaluation
performance
quality-of-implementation
It seems that immediate invocations in constexpr initailizers are evaluated twice, once on evaluating the decl, and again on Sema::HandleImmediateInvocations (this doesn't happen if the var is within a consteval function). Strictly speaking, not a defect, but it's kinda wasteful?
https://godbolt.org/z/7ec5bsK9e
The text was updated successfully, but these errors were encountered: