diff options
author | Yanzuo Liu <zwuis@outlook.com> | 2025-02-08 14:31:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-08 14:31:47 +0800 |
commit | 6f241e36831927e3aea113cfc017c34fdeda340a (patch) | |
tree | 101b7228b3fd6d43d94725058ab72059b9f1dd8a /llvm/lib/CodeGen/MachineCopyPropagation.cpp | |
parent | e0a21e23a7aa6acf3e07b866c3c599db5eb4b67f (diff) | |
download | llvm-6f241e36831927e3aea113cfc017c34fdeda340a.zip llvm-6f241e36831927e3aea113cfc017c34fdeda340a.tar.gz llvm-6f241e36831927e3aea113cfc017c34fdeda340a.tar.bz2 |
[Clang][Sema] Fix wrong initialization kind when handling initializing structured bindings from an array with direct-list-initialization (#124793)
In 377257f063c, elements of structured bindings are copy-initialized.
They should be direct-initialized because the form of the initializer of
the whole structured bindings is a direct-list-initialization.
> [dcl.struct.bind]/1:
> ... and each element is copy-initialized or direct-initialized from
the corresponding element of the assignment-expression as specified by
the form of the initializer. ...
For example,
```cpp
int arr[2]{};
// elements of `[a, b]` should be direct-initialized
auto [a, b]{arr};
```
Diffstat (limited to 'llvm/lib/CodeGen/MachineCopyPropagation.cpp')
0 files changed, 0 insertions, 0 deletions