aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/fn-ptr2.C
blob: 742135a1e38099ae04afe952c274cd97d50690aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// PR c++/56095

int *a(void) { return 0; }
typedef void voidfn(void);
template <voidfn* b> void z1(void) {}
template <voidfn& b> void z2(void) {}

int main()
{
  z1<(voidfn*)a>();		      // { dg-error "" }
  z1<reinterpret_cast<voidfn*>(a)>(); // { dg-error "" }
  z2<(voidfn&)a>();		      // { dg-error "" }
  z2<reinterpret_cast<voidfn&>(a)>(); // { dg-error "" }
}