diff options
author | Alan Zhao <ayzhao@google.com> | 2022-10-03 10:46:46 -0700 |
---|---|---|
committer | Alan Zhao <ayzhao@google.com> | 2022-12-14 07:54:15 -0800 |
commit | 40c52159d3ee337dbed14e4c73b5616ea354c337 (patch) | |
tree | 1dcf0103adeefd635ed25879ec3a09690bf3cbca /llvm/tools/llvm-readobj/llvm-readobj.cpp | |
parent | c165b0553a96394b9bbf3984782703cdae99821d (diff) | |
download | llvm-40c52159d3ee337dbed14e4c73b5616ea354c337.zip llvm-40c52159d3ee337dbed14e4c73b5616ea354c337.tar.gz llvm-40c52159d3ee337dbed14e4c73b5616ea354c337.tar.bz2 |
[clang][C++20] P0960R3 and P1975R0: Allow initializing aggregates from a parenthesized list of values
This patch implements P0960R3, which allows initialization of aggregates
via parentheses.
As an example:
```
struct S { int i, j; };
S s1(1, 1);
int arr1[2](1, 2);
```
This patch also implements P1975R0, which fixes the wording of P0960R3
for single-argument parenthesized lists so that statements like the
following are allowed:
```
S s2(1);
S s3 = static_cast<S>(1);
S s4 = (S)1;
int (&&arr2)[] = static_cast<int[]>(1);
int (&&arr3)[2] = static_cast<int[2]>(1);
```
This patch was originally authored by @0x59616e and completed by
@ayzhao.
Fixes #54040, Fixes #54041
Co-authored-by: Sheng <ox59616e@gmail.com>
Full write up : https://discourse.llvm.org/t/c-20-rfc-suggestion-desired-regarding-the-implementation-of-p0960r3/63744
Reviewed By: ilya-biryukov
Differential Revision: https://reviews.llvm.org/D129531
Diffstat (limited to 'llvm/tools/llvm-readobj/llvm-readobj.cpp')
0 files changed, 0 insertions, 0 deletions