@@ -1037,7 +1037,7 @@ void test() {
1037
1037
1038
1038
namespace GH66612 {
1039
1039
template <typename C>
1040
- auto end (C c) ->int;
1040
+ auto end (C c) ->int; // expected-note {{possible target for call}}
1041
1041
1042
1042
template <typename T>
1043
1043
concept Iterator = true ;
@@ -1047,9 +1047,8 @@ namespace GH66612 {
1047
1047
{ end } -> Iterator; // #66612GH_END
1048
1048
};
1049
1049
1050
- static_assert (Container<int >);// expected-error{{static assertion failed}}
1051
- // expected-note@-1{{because 'int' does not satisfy 'Container'}}
1052
- // expected-note@#66612GH_END{{because 'end' would be invalid: reference to overloaded function could not be resolved; did you mean to call it?}}
1050
+ static_assert (Container<int >);
1051
+ // expected-error@#66612GH_END{{reference to overloaded function could not be resolved; did you mean to call it?}}
1053
1052
}
1054
1053
1055
1054
namespace GH66938 {
@@ -1407,7 +1406,6 @@ static_assert(!std::is_constructible_v<span<4>, array<int, 3>>);
1407
1406
1408
1407
}
1409
1408
1410
-
1411
1409
namespace GH162125 {
1412
1410
template <typename , int size>
1413
1411
concept true_int = (size, true );
@@ -1444,3 +1442,37 @@ struct s {
1444
1442
1445
1443
void (*test)(int ) = &s<bool >::f<int >;
1446
1444
}
1445
+ namespace GH51246 {
1446
+ void f (); // expected-note {{possible target for call}}
1447
+ void f (int ); // expected-note {{possible target for call}}
1448
+ void g ();
1449
+ static_assert (requires { f; }); // expected-error {{reference to overloaded function could not be resolved}}
1450
+ static_assert (requires { g; });
1451
+ struct S {
1452
+ void mf () {
1453
+ static_assert (requires { mf (); });
1454
+ static_assert (requires { mf; }); // expected-error {{reference to non-static member function must be called}}
1455
+ static_assert (requires { S::mf; }); // expected-error {{reference to non-static member function must be called}}
1456
+ }
1457
+ void mf2 (int ); // expected-note 2{{possible target for call}}
1458
+ void mf2 () { // expected-note 2{{possible target for call}}
1459
+ static_assert (requires { mf2; }); // expected-error {{reference to non-static member function must be called}}
1460
+ static_assert (requires { S::mf2; }); // expected-error {{reference to non-static member function must be called}}
1461
+ }
1462
+ };
1463
+
1464
+ } // namespace GH51246
1465
+
1466
+
1467
+ namespace GH97753 {
1468
+
1469
+ void f (); // expected-note {{possible target for call}}
1470
+ void f (int ); // expected-note {{possible target for call}}
1471
+
1472
+ template <typename T>
1473
+ concept C = sizeof (T) == 42 ;
1474
+
1475
+ static_assert ( requires {{ &f } -> C;} ); // expected-error {{reference to overloaded function could not be resolved;}}
1476
+ // expected-error@-1 {{static assertion failed due to requirement 'requires { { &f() } -> C; }'}}
1477
+
1478
+ }
0 commit comments