This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Request for a C++ warning for undefined behaviour
- From: skaller <skaller at ozemail dot com dot au>
- To: Michael Matz <matz at suse dot de>
- Cc: Igor Bukanov <igor at fastmail dot fm>, gcc at gcc dot gnu dot org
- Date: 14 Aug 2003 00:52:47 +1000
- Subject: Re: Request for a C++ warning for undefined behaviour
- Organization:
- References: <Pine.LNX.4.44.0308131525280.19843-100000@wotan.suse.de>
- Reply-to: skaller at ozemail dot com dot au
On Wed, 2003-08-13 at 23:30, Michael Matz wrote:
> Although this is not at all the same as my original issue, which was about
> calling members of an object under construction whose bases weren't yet
> initialized.
Yes, I know that was the cause of the problem,
however the diagnostic you were talking about would detect
breaches in ctor-initialisers.
> But if we are constructing interesting examples I have another one:
>
> struct X { int x; X(int x) : x(x) {} };
>
> This one is ok (!) and initializes X::x with the value of the constructor
> parameter 'x' ;-)
Ouch! Who invented the scoping rules in C++ again?
[Woops .. I might be doing myself in here .. ]