| 1 |
// RUN: %clang_cc1 -std=c++20 -verify %s |
| 2 |
|
| 3 |
namespace P1972 { |
| 4 |
template <typename T> |
| 5 |
struct S { |
| 6 |
static void f(int) |
| 7 |
requires false; // expected-note 4{{because 'false' evaluated to false}} |
| 8 |
}; |
| 9 |
void g() { |
| 10 |
S<int>::f(0); // expected-error{{invalid reference to function 'f': constraints not satisfied}} |
| 11 |
void (*p1)(int) = S<int>::f; // expected-error{{invalid reference to function 'f': constraints not satisfied}} |
| 12 |
void (*p21)(int) = &S<int>::f; // expected-error{{invalid reference to function 'f': constraints not satisfied}} |
| 13 |
decltype(S<int>::f) *p2 = nullptr; // expected-error{{invalid reference to function 'f': constraints not satisfied}} |
| 14 |
} |
| 15 |
} |