This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23804] reference initialization with compile-time bogus value
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Sep 2005 01:30:00 -0000
- Subject: [Bug c++/23804] reference initialization with compile-time bogus value
- References: <20050910012043.23804.ivan@sierra-da.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-10 01:30 -------
You should get a warning with -Wuninitialized at -O1 and above.
In fact I do get one for the following code:
int f(void)
{
int *p;
int &r = *p;
return r;
}
---
4.0.0 and above's output:
t.cc: In function 'int f()':
t.cc:4: warning: 'p' is used uninitialized in this function
before 3.3's output:
t.cc: In function `int f()':
t.cc:3: warning: `int*p' might be used uninitialized in this function
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23804