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: Igor Bukanov <igor at fastmail dot fm>
- Cc: gcc at gcc dot gnu dot org
- Date: 13 Aug 2003 22:14:54 +1000
- Subject: Re: Request for a C++ warning for undefined behaviour
- Organization:
- References: <3F3A08E1.1000200@fastmail.fm>
- Reply-to: skaller at ozemail dot com dot au
On Wed, 2003-08-13 at 19:46, Igor Bukanov wrote:
> It would also be nice if GCC would warn about the following code:
>
> int x = x + 1;
>
Actually there is an interesting variant that exhibits both
this issue and the one raise by Michael Matx:
struct X { int x; X() : x(x) {} };
which not only initialises a variable to itself,
but also manages to refer to a variable before its
ctor-initialiser has initialised it :-)