yronglin wrote:

> Why is creating those variables necessary, what part about the reproducer 
> doesn't work in the current interpreter, and why would the new one support it?

Seems current interpreter treats `&sre == &__real scf` and `&sim == &__imag 
scf` not an integral constant expression. 
https://godbolt.org/z/hMEaxax6W

```
➜  test ../rel/bin/clang -c  -fexperimental-new-constant-interpreter ./bug1.cpp
➜  test ../rel/bin/clang -c  ./bug1.cpp 
./bug1.cpp:6:19: error: static assertion expression is not an integral constant 
expression
    6 |     static_assert(&sre == &__real scf);
      |                   ^~~~~~~~~~~~~~~~~~~
./bug1.cpp:3:12: note: initializer of '[sre, sim]' is not a constant expression
    3 |     auto &[sre, sim] = scf;
      |            ^
./bug1.cpp:3:11: note: declared here
    3 |     auto &[sre, sim] = scf;
      |           ^
./bug1.cpp:7:19: error: static assertion expression is not an integral constant 
expression
    7 |     static_assert(&sim == &__imag scf);
      |                   ^~~~~~~~~~~~~~~~~~~
./bug1.cpp:3:17: note: initializer of '[sre, sim]' is not a constant expression
    3 |     auto &[sre, sim] = scf;
      |                 ^
./bug1.cpp:3:11: note: declared here
    3 |     auto &[sre, sim] = scf;
      |           ^
2 errors generated.
```

https://github.com/llvm/llvm-project/pull/100565
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to