[Bug c++/63203] Self-initialization of reference not diagnosed if it occurs within a loop

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Sep 8 09:17:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63203

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-09-08
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
IMHO we should have a specific check for self-initialized references, instead
of relying on the compiler to identify the use of an uninitialized variable in
later code.

Doing self-init for references to silence uninitialized warnings makes no
sense, because you can't re-bind the reference later, so it will always stay
uselessly bound to itself.



More information about the Gcc-bugs mailing list