diff options
author | yronglin <yronglin777@gmail.com> | 2024-07-25 19:44:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-25 19:44:25 +0800 |
commit | 534e2dd29f252cc13b94312895d2f4b39b54b9d4 (patch) | |
tree | 410d44dcb7a38b346766b4668a559bdd3b7d24e0 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 90929dd97a8f2c00148bee676bf8b44bec063d9b (diff) | |
download | llvm-534e2dd29f252cc13b94312895d2f4b39b54b9d4.zip llvm-534e2dd29f252cc13b94312895d2f4b39b54b9d4.tar.gz llvm-534e2dd29f252cc13b94312895d2f4b39b54b9d4.tar.bz2 |
[Clang][Interp] Visit `DecompositionDecl` and create a local variable (#100400)
The following code should be well-formed:
```C++
float decompose_complex(_Complex float cf) {
static _Complex float scf;
auto &[sre, sim] = scf;
// ok, this is references initialized by constant expressions all the way down
static_assert(&sre == &__real scf);
static_assert(&sim == &__imag scf);
auto [re, im] = cf;
return re*re + im*im;
}
```
We should visit `DecompositionDecl` and create a local variable but not
a create a dummy value directly.
---------
Signed-off-by: yronglin <yronglin777@gmail.com>
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions