This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug c++/23804] reference initialization with compile-time bogus value


------- 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


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