Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wconditionally-supported-1.C
blob8cc5966eda823e628f339aec93c0cb04f9e16ed2
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);
11 typedef void *PV;
12 typedef int *PO;
14 void foo ()
16   PF pf;
17   PV pv;
18   PO po;
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" }