gcc/testsuite/g++.dg/template/ptrmem31.C
raw| 1 | // PR c++/80639 |
| 2 | // { dg-do compile { target c++14 } } |
| 3 | |
| 4 | template < typename > struct A; |
| 5 | |
| 6 | struct B |
| 7 | { |
| 8 | template < int > void m (); |
| 9 | template < int > struct K { static void n (); }; |
| 10 | void p () { K < 0 >::n (); } |
| 11 | }; |
| 12 | |
| 13 | template <> struct A < B > |
| 14 | { |
| 15 | using T = void (A::*)(); |
| 16 | template < int u > static constexpr T h = &B::m < u >; // { dg-error "cannot convert" } |
| 17 | }; |
| 18 | |
| 19 | template < int v > void B::K < v >::n () |
| 20 | { |
| 21 | using S = A < B >; |
| 22 | S::h < 0 >; |
| 23 | } |