Skip to content

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

@spall

Description

@spall
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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    HLSLHLSL Language Support

    Type

    No type

    Projects

    Status

    Planning

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions