gcc/testsuite/g++.dg/DRs/dr2918.C
raw| 1 | // CWG 2918 makes this OK |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template<bool B> struct X { |
| 5 | static void f(short) requires B; // #1 |
| 6 | static void f(short); // #2 |
| 7 | }; |
| 8 | void test() { |
| 9 | auto x = &X<true>::f; // OK, deduces void(*)(short), selects #1 |
| 10 | auto y = &X<false>::f; // OK, deduces void(*)(short), selects #2 |
| 11 | } |