llvm / llvm/llvm-project

[HLSL] Assertion hit evaluating constexpr of InitListExpr which contains multiple MaterializeTemporaryExpr

Open
#188,577 0 comments 0 reactions 0 assignees View on GitHub
HLSL
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

```hlsl
export void fn() {

// splat from a vector of size 1 in an init list
constexpr int1 A1 = {1};
constexpr uint64_t2 A72[2] = {(uint64_t2[2])A1};
_Static_assert(A72[0][0] == 1, "Woo!");
_Static_assert(A72[0][1] == 1, "Woo!");
_Static_assert(A72[1][0] == 1, "Woo!");
_Static_assert(A72[1][1] == 1, "Woo!");
}
```
Assertion: llvm-project/llvm/tools/clang/lib/AST/ExprConstant.cpp:1831: clang::APValue& {anonymous}::CallStackFrame::createLocal(clang::APValue::LValueBase, const void*, clang::QualType, {anonymous}::ScopeKind): Assertion `Result.isAbsent() && "local created multiple times"' failed.

https://godbolt.org/z/s4vWqKs16
https://godbolt.org/z/rWdKPTf9o (shows the AST with the MaterializeTemporaryExpr(s))

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.