File tree 3 files changed +8
-6
lines changed 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -258,9 +258,11 @@ Resolutions to C++ Defect Reports
258
258
a single element of the same type instead of always copying.
259
259
(`CWG2137: List-initialization from object of same type <https://cplusplus.github.io/CWG/issues/2137.html> `)
260
260
261
- - Implemented `CWG2311 <https://wg21.link/CWG2311 >`_: given a prvalue ``e `` of object type
262
- ``T ``, ``T{e} `` will try to resolve an initializer list constructor and will use it if successful (CWG2137).
261
+ - Speculative resolution for CWG2311 implemented so that the implementation of CWG2137 doesn't remove
262
+ previous cases where guaranteed copy elision was done. Given a prvalue ``e `` of class type
263
+ ``T ``, ``T{e} `` will try to resolve an initializer list constructor and will use it if successful.
263
264
Otherwise, if there is no initializer list constructor, the copy will be elided as if it was ``T(e) ``.
265
+ (`CWG2311: Missed case for guaranteed copy elision <https://cplusplus.github.io/CWG/issues/2311.html> `)
264
266
265
267
C Language Changes
266
268
------------------
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ struct Z : W,
104
104
// cwg2331: na
105
105
// cwg2335 is in cwg2335.cxx
106
106
107
- namespace dr2311 { // dr2311: 18 open
107
+ namespace cwg2311 { // cwg2311 is open with no proposed resolution
108
108
#if __cplusplus >= 201707L
109
109
template <typename T>
110
110
void test () {
@@ -170,12 +170,12 @@ struct any {
170
170
template <typename T>
171
171
struct X {
172
172
X ();
173
- X (T) = delete ; // #dr2311 -X
173
+ X (T) = delete ; // #cwg2311 -X
174
174
};
175
175
176
176
X<std::initializer_list<any>> x{ X<std::initializer_list<any>>() };
177
177
// since-cxx17-error@-1 {{call to deleted constructor of 'X<std::initializer_list<any>>'}}
178
- // since-cxx17-note@#dr2311 -X {{'X' has been explicitly marked deleted here}}
178
+ // since-cxx17-note@#cwg2311 -X {{'X' has been explicitly marked deleted here}}
179
179
#endif
180
180
}
181
181
Original file line number Diff line number Diff line change @@ -13674,7 +13674,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
13674
13674
<td><a href="https://cplusplus.github.io/CWG/issues/2311.html">2311</a></td>
13675
13675
<td>open</td>
13676
13676
<td>Missed case for guaranteed copy elision</td>
13677
- <td class="unreleased" align="center">Clang 18 </td>
13677
+ <td align="center">Not resolved </td>
13678
13678
</tr>
13679
13679
<tr id="2312">
13680
13680
<td><a href="https://cplusplus.github.io/CWG/issues/2312.html">2312</a></td>
You can’t perform that action at this time.
0 commit comments