gcc/testsuite/g++.dg/cpp1z/noexcept-type23.C
raw| 1 | // PR c++/99374 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | |
| 4 | struct S; |
| 5 | struct R; |
| 6 | using F1 = int (S::*)(); |
| 7 | using F2 = int (S::*)() noexcept; |
| 8 | using F3 = int (R::*)() noexcept; |
| 9 | using T = S; |
| 10 | using F4 = int (T::*)() noexcept; |
| 11 | F1 f21 = F2(); |
| 12 | F1 f41 = F4(); |
| 13 | F2 f12 = F1(); // { dg-error "cannot convert" } |
| 14 | F1 f31 = F3(); // { dg-error "cannot convert" } |