This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Request for a C++ warning for undefined behaviour


On 13 Aug 2003, skaller wrote:

> The code exhibited appears quite perverted to me ..

It's a constructed example.  Hence it is natural that it of course shows
the error quite clearly.  Everything else wouldn't be a good testcase.
Like I said, here it is indeed obvious.  It was not in the original case.

> > See above.  That's not enough.  One would have to go for instance through
> > a normal file-static function.
> No, you can use a pointer, even this. Then the call is dispatched.

Sure.  There are multiple methods of hiding this error.  I just said, that
wrapping by a non-virtual member is not enough, as that already invokes
undefined behaviour.

> If I have to calculate something to initialise a base (which cannot be
> assigned in a ctor body) I *definitely* have a design fault.

Okay, so with your all-singing-all-dancing design you'll never see the
hypothetical error message.  Good.  What are you arguing then exactly?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]