1 // { dg-options "-Wconditionally-supported" }
2 
3 // DR 195 was about allowing conversions between function and object
4 // pointers under some circumstances.  The issue got resolved for C++11,
5 // which, in 5.2.10 p8 says that: "Converting a function pointer to an
6 // object pointer type or vice versa is conditionally-supported."
7 
8 // This checks we warn with -Wconditionally-supported.
9 
10 typedef void (*PF)(void);
11 typedef void *PV;
12 typedef int *PO;
13 
foo()14 void foo ()
15 {
16   PF pf;
17   PV pv;
18   PO po;
19 
20   pf = reinterpret_cast <PF>(pv); // { dg-warning "conditionally-supported" }
21   pv = reinterpret_cast <PV>(pf); // { dg-warning "conditionally-supported" }
22 
23   pf = reinterpret_cast <PF>(po); // { dg-warning "conditionally-supported" }
24   po = reinterpret_cast <PO>(pf); // { dg-warning "conditionally-supported" }
25 }
26