1 // { dg-options "-Wconditionally-supported" }
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."
8 // This checks we warn with -Wconditionally-supported.
10 typedef void (*PF)(void);
20 pf = reinterpret_cast <PF>(pv); // { dg-warning "conditionally-supported" }
21 pv = reinterpret_cast <PV>(pf); // { dg-warning "conditionally-supported" }
23 pf = reinterpret_cast <PF>(po); // { dg-warning "conditionally-supported" }
24 po = reinterpret_cast <PO>(pf); // { dg-warning "conditionally-supported" }