[libcxx-commits] [clang] [libcxx] [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (PR #77768)
Mital Ashok via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jan 13 06:41:30 PST 2024
================
@@ -132,6 +142,36 @@ namespace dr2126 { // dr2126: 12
#endif
}
+namespace dr2137 { // dr2137: 18
+#if __cplusplus >= 201103L
+ struct Q {
+ Q();
+ Q(Q&&);
+ Q(std::initializer_list<Q>) = delete; // since-cxx11-note 2 {{has been explicitly marked deleted here}}
+ };
+
+ Q x = Q { Q() }; // since-cxx11-error {{call to deleted constructor}}
+
+ int f(Q); // since-cxx11-note {{passing argument to parameter here}}
+ int y = f({ Q() }); // since-cxx11-error {{call to deleted constructor}}
----------------
MitalAshok wrote:
@Endilll Is this good now? Thanks in advance
https://github.com/llvm/llvm-project/pull/77768/files#diff-3426b975672f064b9f32caf4ebab729b815f4f65aa3e76bda4b5bdee986e2e6fR130-R131
https://github.com/llvm/llvm-project/pull/77768/files#diff-8807231ab4d193692d6cecdc6428aaf3c55dfd96101cff8fe0eb7034654658fbR154-R161
https://github.com/llvm/llvm-project/pull/77768
More information about the libcxx-commits
mailing list