gcc/testsuite/g++.dg/template/crash127.C
raw| 1 | // PR c++/71440 |
| 2 | |
| 3 | struct A |
| 4 | { |
| 5 | void f () {} |
| 6 | }; |
| 7 | |
| 8 | typedef void (A::*Ptr) (); |
| 9 | |
| 10 | template < Ptr > struct B {}; |
| 11 | |
| 12 | template < class T > |
| 13 | struct C : public A |
| 14 | { |
| 15 | void bar () |
| 16 | { |
| 17 | B < &A::A > b; // { dg-error "taking address of constructor 'A::A" "" { target c++98_only } } |
| 18 | // { dg-error "taking address of constructor 'constexpr A::A" "" { target c++11 } .-1 } |
| 19 | // { dg-error "template argument 1 is invalid" "" { target *-*-* } .-2 } |
| 20 | } |
| 21 | }; |