-pedantic-errors, ? : and ptrs to base classes

Martin von Loewis martin@mira.isdn.cs.tu-berlin.de
Sun Sep 6 13:38:00 GMT 1998


> I recommend having a look at 4.10. I think a pointer conversion is taking
> place.

4.10 tells me that a conversion from pD1 to B* is valid. It does not
say it is performed implicitly, not does any other part of the spec
say so.

To make the expression valid, you can write

   foo ? (B*)pD1 : (B*)pD2;

The conversions

Martin



More information about the Gcc-bugs mailing list