This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
-pedantic-errors, ? : and ptrs to base classes
- To: egcs-bugs at cygnus dot com
- Subject: -pedantic-errors, ? : and ptrs to base classes
- From: David C Binderman <dcb at pncl dot co dot uk>
- Date: Wed, 2 Sep 1998 19:40:56 +0100 (BST)
Hello there,
// I think this code should compile.
// On Linux / Alpha egcs-980824 with no flags it does.
// However, when I use flags -ansi -pedantic-errors, it does not.
//
// I think there is nothing wrong with the code,
// and so an error should not be produced.
struct B {};
struct D1 : public B {};
struct D2 : public B {};
B *
f( int i, D1 * pD1, D2 * pD2)
{
return i ? pD1 : pD2;
};
Regards
David C Binderman MSc BSc +44 1293 534847 dcb@pncl.co.uk