You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This is only invalid if we call T's call operator.
219
217
template <typename T, typename U>
220
-
structO6 : privateT, U { //expected-note {{declared private here}}
218
+
structO6 : privateT, U { //#cwg2881-O6
221
219
usingT::operator();
222
220
usingU::operator();
223
221
O6(T t, U u) : T(t), U(u) {}
@@ -227,14 +225,26 @@ void f() {
227
225
int x;
228
226
auto L1 = [=](thisauto&& self) { (void) &x; };
229
227
auto L2 = [&](thisauto&& self) { (void) &x; };
230
-
O1<decltype(L1)>{L1, L1}(); // expected-error {{inaccessible due to ambiguity}}
231
-
O1<decltype(L2)>{L2, L2}(); // expected-error {{inaccessible due to ambiguity}}
232
-
O2{L1}(); // expected-error {{must derive publicly from the lambda}}
233
-
O3{L1}(); // expected-error {{must derive publicly from the lambda}}
228
+
O1<decltype(L1)>{L1, L1}();
229
+
/* since-cxx23-error-re@-1 {{inaccessible due to ambiguity:
230
+
struct cwg2881::O1<class (lambda at {{.+}})> -> A<(lambda at {{.+}})> -> class (lambda at {{.+}})
231
+
struct cwg2881::O1<class (lambda at {{.+}})> -> B<(lambda at {{.+}})> -> class (lambda at {{.+}})}}*/
232
+
O1<decltype(L2)>{L2, L2}();
233
+
/* since-cxx23-error-re@-1 {{inaccessible due to ambiguity:
234
+
struct cwg2881::O1<class (lambda at {{.+}})> -> A<(lambda at {{.+}})> -> class (lambda at {{.+}})
235
+
struct cwg2881::O1<class (lambda at {{.+}})> -> B<(lambda at {{.+}})> -> class (lambda at {{.+}})}}*/
236
+
O2{L1}();
237
+
// since-cxx23-error-re@-1 {{invalid explicit object parameter type 'cwg2881::O2<(lambda at {{.+}})>' in lambda with capture; the type must derive publicly from the lambda}}
// since-cxx23-error-re@-1 {{invalid explicit object parameter type 'cwg2881::O3<(lambda at {{.+}})>' in lambda with capture; the type must derive publicly from the lambda}}
o.decltype(L1)::operator()(); // expected-error {{must derive publicly from the lambda}}
245
+
o.decltype(L1)::operator()();
246
+
// since-cxx23-error-re@-1 {{invalid explicit object parameter type 'cwg2881::O6<(lambda at {{.+}}), (lambda at {{.+}})>' in lambda with capture; the type must derive publicly from the lambda}}
f3(lambda); // expected-error {{no matching function for call to 'f3'}}
286
-
f4(lambda); // expected-error {{no matching function for call to 'f4'}}
287
-
// expected-note@-1 {{while substituting deduced template arguments into function template 'f4'}}
299
+
f3(lambda);
300
+
// since-cxx23-error@-1 {{no matching function for call to 'f3'}}
301
+
// since-cxx23-note-re@#cwg2881-f3 {{candidate template ignored: substitution failure [with L = (lambda at {{.+}})]: invalid explicit object parameter type 'cwg2881::Private<(lambda at {{.+}})>' in lambda with capture; the type must derive publicly from the lambda}}
302
+
f4(lambda); // #cwg2881-f4-call
303
+
// expected-error@-1 {{no matching function for call to 'f4'}}
304
+
// expected-note-re@-2 {{while substituting deduced template arguments into function template 'f4' [with L = (lambda at {{.+}})]}}
305
+
/* expected-note-re@#cwg2881-f4 {{candidate template ignored: substitution failure [with L = (lambda at {{.+}})]: lambda '(lambda at {{.+}})' is inaccessible due to ambiguity:
306
+
struct cwg2881::Ambiguous<class (lambda at {{.+}})> -> Indirect<(lambda at {{.+}})> -> class (lambda at {{.+}})
307
+
struct cwg2881::Ambiguous<class (lambda at {{.+}})> -> class (lambda at {{.+}})}}*/
0 commit comments