PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / conversion / dr195-1.C
blob8b3f2855a120de3c3b76869a0b166425071f33db
1 // { dg-options "" }
3 // Copyright (C) 2004 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 20 Oct 2004 <nathan@codesourcery.com>
6 // DR 195 will allow conversions between function and object pointers
7 // under some circumstances. It is in drafting, so we don't implement
8 // it (yet).
10 // this checks we are silent when not being pedantic.
12 typedef void (*PF)(void);
13 typedef void *PV;
14 typedef int *PO;
17 void foo ()
19   PF pf;
20   PV pv;
21   PO po;
23   /* the following two will almost definitly be ok with 195.  */
24   pf = reinterpret_cast <PF>(pv);
25   pv = reinterpret_cast <PV>(pf);
27   /* the following two might or might not be ok with 195.  */
28   pf = reinterpret_cast <PF>(po);
29   po = reinterpret_cast <PO>(pf);
31   /* These will never be ok, as they are implicit.  */
32   pv = pf; // { dg-error "invalid conversion" }
33   pf = pv; // { dg-error "invalid conversion" }