Issue |
117321
|
Summary |
[clang] Immediate invocations in constexpr initailizers are evaluated twice
|
Labels |
clang
|
Assignees |
|
Reporter |
groundswellaudio
|
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?
```cpp
consteval int foo(int* b) {
return *b; // Evaluation errors are emitted twice
}
constexpr int a = foo(nullptr);
```
https://godbolt.org/z/7ec5bsK9e
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs