aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Lexer/cxx-features.cpp
diff options
context:
space:
mode:
authorAlan Zhao <ayzhao@google.com>2023-01-04 15:12:00 -0800
committerAlan Zhao <ayzhao@google.com>2023-01-12 09:58:15 -0800
commit95a4c0c83554c025ef709a6805e67233d0dedba0 (patch)
tree26a4aefbb2ab9ade7f32529a630b8e8341f63459 /clang/test/Lexer/cxx-features.cpp
parent81f57b6b994907267e981e09c1789529ec0a91c9 (diff)
downloadllvm-95a4c0c83554c025ef709a6805e67233d0dedba0.zip
llvm-95a4c0c83554c025ef709a6805e67233d0dedba0.tar.gz
llvm-95a4c0c83554c025ef709a6805e67233d0dedba0.tar.bz2
[clang] Reland parenthesized aggregate init patches
This commit relands the patches for implementing P0960R3 and P1975R0, which describe initializing aggregates via a parenthesized list. The relanded commits are: * 40c52159d3ee - P0960R3 and P1975R0: Allow initializing aggregates from a parenthesized list of values * c77a91bb7ba7 - Remove overly restrictive aggregate paren init logic * 32d7aae04fdb - Fix a clang crash on invalid code in C++20 mode This patch also fixes a crash in the original implementation. Previously, if the input tried to call an implicitly deleted copy or move constructor of a union, we would then try to initialize the union by initializing it's first element with a reference to a union. This behavior is incorrect (we should fail to initialize) and if the type of the first element has a constructor with a single template typename parameter, then Clang will explode. This patch fixes that issue by checking that constructor overload resolution did not result in a deleted function before attempting parenthesized aggregate initialization. Additionally, this patch also includes D140159, which contains some minor fixes made in response to code review comments in the original implementation that were made after that patch was submitted. Co-authored-by: Sheng <ox59616e@gmail.com> Fixes #54040, Fixes #59675 Reviewed By: ilya-biryukov Differential Revision: https://reviews.llvm.org/D141546
Diffstat (limited to 'clang/test/Lexer/cxx-features.cpp')
-rw-r--r--clang/test/Lexer/cxx-features.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/test/Lexer/cxx-features.cpp b/clang/test/Lexer/cxx-features.cpp
index 67b5265..4a2bf56 100644
--- a/clang/test/Lexer/cxx-features.cpp
+++ b/clang/test/Lexer/cxx-features.cpp
@@ -61,8 +61,7 @@
// --- C++20 features ---
-#if check(aggregate_paren_init, 0, 0, 0, 0, 0, 0)
-// FIXME: 201902 in C++20
+#if check(aggregate_paren_init, 0, 0, 0, 0, 201902, 201902)
#error "wrong value for __cpp_aggregate_paren_init"
#endif