Debian Codegraph @

gcc/testsuite/g++.dg/template/fn-ptr2.C

raw
1 // PR c++/56095
2
3 int *a(void) { return 0; }
4 typedef void voidfn(void);
5 template <voidfn* b> void z1(void) {}
6 template <voidfn& b> void z2(void) {}
7
8 int main()
9 {
10 z1<(voidfn*)a>(); // { dg-error "" }
11 z1<reinterpret_cast<voidfn*>(a)>(); // { dg-error "" }
12 z2<(voidfn&)a>(); // { dg-error "" }
13 z2<reinterpret_cast<voidfn&>(a)>(); // { dg-error "" }
14 }