@@ -30,7 +30,7 @@ using U2 = decltype(&main);
30
30
#endif
31
31
} // namespace cwg2811
32
32
33
- namespace cwg2819 { // cwg2819: 19 tentatively ready 2023-12-01
33
+ namespace cwg2819 { // cwg2819: 19
34
34
#if __cpp_constexpr >= 202306L
35
35
constexpr void * p = nullptr ;
36
36
constexpr int * q = static_cast <int *>(p);
@@ -111,7 +111,7 @@ struct D : N::B {
111
111
#endif
112
112
} // namespace cwg2857
113
113
114
- namespace cwg2858 { // cwg2858: 19 tentatively ready 2024-04-05
114
+ namespace cwg2858 { // cwg2858: 19
115
115
116
116
#if __cplusplus > 202302L
117
117
@@ -134,23 +134,23 @@ struct A {
134
134
135
135
} // namespace cwg2858
136
136
137
- namespace cwg2877 { // cwg2877: 19 tentatively ready 2024-05-31
137
+ namespace cwg2877 { // cwg2877: 19
138
138
#if __cplusplus >= 202002L
139
139
enum E { x };
140
140
void f () {
141
141
int E;
142
- using enum E; // OK, names ::E
142
+ using enum E; // OK
143
143
}
144
144
using F = E;
145
- using enum F; // OK, designates ::E
145
+ using enum F; // OK
146
146
template <class T > using EE = T;
147
147
void g () {
148
- using enum EE<E>; // OK, designates ::E
148
+ using enum EE<E>; // OK
149
149
}
150
150
#endif
151
151
} // namespace cwg2877
152
152
153
- namespace cwg2881 { // cwg2881: 19 tentatively ready 2024-04-19
153
+ namespace cwg2881 { // cwg2881: 19
154
154
155
155
#if __cplusplus >= 202302L
156
156
@@ -216,11 +216,61 @@ void f() {
216
216
o.decltype (L2)::operator ()();
217
217
}
218
218
219
+ void f2 () {
220
+ int x = 0 ;
221
+ auto lambda = [x] (this auto self) { return x; };
222
+ using Lambda = decltype (lambda);
223
+ struct D : private Lambda { // expected-note {{declared private here}}
224
+ D (Lambda l) : Lambda(l) {}
225
+ using Lambda::operator ();
226
+ friend Lambda;
227
+ } d (lambda);
228
+ d (); // expected-error {{must derive publicly from the lambda}}
229
+ }
230
+
231
+ template <typename L>
232
+ struct Private : private L {
233
+ using L::operator ();
234
+ Private (L l) : L(l) {}
235
+ };
236
+
237
+ template <typename T>
238
+ struct Indirect : T {
239
+ using T::operator ();
240
+ };
241
+
242
+ template <typename T>
243
+ struct Ambiguous : Indirect<T>, T { // expected-warning {{is inaccessible due to ambiguity}}
244
+ using Indirect<T>::operator ();
245
+ };
246
+
247
+ template <typename L>
248
+ constexpr auto f3 (L l) -> decltype(Private<L>{l}()) { return l (); }
249
+ // expected-note@-1 {{must derive publicly from the lambda}}
250
+
251
+ template <typename L>
252
+ constexpr auto f4 (L l) -> decltype(Ambiguous<L>{{l}, l}()) { return l (); }
253
+ // expected-note@-1 {{is inaccessible due to ambiguity}}
254
+ // expected-note@-2 {{in instantiation of template class}}
255
+
256
+ template <typename T>
257
+ concept is_callable = requires(T t) { { t () }; };
258
+
259
+ void g () {
260
+ int x = 0 ;
261
+ auto lambda = [x](this auto self) {};
262
+ f3 (lambda); // expected-error {{no matching function for call to 'f3'}}
263
+ f4 (lambda); // expected-error {{no matching function for call to 'f4'}}
264
+ // expected-note@-1 {{while substituting deduced template arguments into function template 'f4'}}
265
+ static_assert (!is_callable<Private<decltype (lambda)>>);
266
+ static_assert (!is_callable<Ambiguous<decltype (lambda)>>);
267
+ }
268
+
219
269
#endif
220
270
221
271
} // namespace cwg2881
222
272
223
- namespace cwg2882 { // cwg2882: 2.7 tentatively ready 2024-05-31
273
+ namespace cwg2882 { // cwg2882: 2.7
224
274
struct C {
225
275
operator void () = delete;
226
276
// expected-warning@-1 {{conversion function converting 'cwg2882::C' to 'void' will never be used}}
@@ -232,7 +282,7 @@ void f(C c) {
232
282
}
233
283
} // namespace cwg2882
234
284
235
- namespace cwg2883 { // cwg2883: no tentatively ready 2024-05-31
285
+ namespace cwg2883 { // cwg2883: no
236
286
#if __cplusplus >= 201103L
237
287
void f () {
238
288
int x;
@@ -257,7 +307,7 @@ void g() {
257
307
#endif
258
308
} // namespace cwg2883
259
309
260
- namespace cwg2885 { // cwg2885: 16 tentatively ready 2024-05-31
310
+ namespace cwg2885 { // cwg2885: 16 review 2024-05-31
261
311
#if __cplusplus >= 202002L
262
312
template <class T >
263
313
struct A {
@@ -271,7 +321,7 @@ static_assert(!__is_trivially_constructible(B));
271
321
#endif
272
322
} // namespace cwg2885
273
323
274
- namespace cwg2886 { // cwg2886: 9 tentatively ready 2024-05-31
324
+ namespace cwg2886 { // cwg2886: 9
275
325
#if __cplusplus >= 201103L
276
326
struct C {
277
327
C () = default ;
0 commit comments