https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/67931
Related: #63416 >From 4720a0f6bce7b1531dec2005d642938db1370335 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov <serebrennikov.vladis...@gmail.com> Date: Sun, 1 Oct 2023 21:28:21 +0300 Subject: [PATCH] [clang] Add test for CWG2267 --- clang/test/CXX/drs/dr22xx.cpp | 22 ++++++++++++++++++++++ clang/www/cxx_dr_status.html | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/clang/test/CXX/drs/dr22xx.cpp b/clang/test/CXX/drs/dr22xx.cpp index 414925f0d74cc2e..cd849443b1119ba 100644 --- a/clang/test/CXX/drs/dr22xx.cpp +++ b/clang/test/CXX/drs/dr22xx.cpp @@ -123,6 +123,28 @@ namespace CheckAfterMerging2 { #endif } // namespace dr2233 +namespace dr2267 { // dr2267: no +#if __cplusplus >= 201103L +struct A {} a; +struct B { explicit B(const A&); }; // #dr2267-struct-B + +struct D { D(); }; +struct C { explicit operator D(); } c; + +B b1(a); +const B &b2{a}; // FIXME ill-formed +const B &b3(a); +// expected-error@-1 {{no viable conversion from 'struct A' to 'const B'}} +// expected-note@#dr2267-struct-B {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'struct A' to 'const B &' for 1st argument}} +// expected-note@#dr2267-struct-B {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'struct A' to 'B &&' for 1st argument}} +// expected-note@#dr2267-struct-B {{explicit constructor is not a candidate}} + +D d1(c); +const D &d2{c}; // FIXME ill-formed +const D &d3(c); // FIXME ill-formed +#endif +} + namespace dr2292 { // dr2292: 9 #if __cplusplus >= 201103L template<typename T> using id = T; diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html index ee9712e9bab9949..49386bbbc44c80f 100755 --- a/clang/www/cxx_dr_status.html +++ b/clang/www/cxx_dr_status.html @@ -13409,7 +13409,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2> <td><a href="https://cplusplus.github.io/CWG/issues/2267.html">2267</a></td> <td>CD5</td> <td>Copy-initialization of temporary in reference direct-initialization</td> - <td class="none" align="center">Unknown</td> + <td class="none" align="center">No</td> </tr> <tr id="2268"> <td><a href="https://cplusplus.github.io/CWG/issues/2268.html">2268</a></td> _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits