public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39045]  New: Not inited referense.
@ 2009-01-30 20:50 alexey dot veselovsky at gmail dot com
  2009-02-01  5:18 ` [Bug c++/39045] No warning for uninitialized reference bangerth at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: alexey dot veselovsky at gmail dot com @ 2009-01-30 20:50 UTC (permalink / raw)
  To: gcc-bugs

g++ allows to exist not inited reference in this case:

struct X
{
   int &x;
};

int main()
{
    X* p_x = new X; // now there is not inited reference (p_x->x)
    // now we can try to use p_x->x
    std::cout << p_x->x << std::endl; // segmentation fault
    return 0;
}

There are no errors or warnings. Compilation is successfull. 

I have tested on g++ (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3).
Also it "works" on g++ 4.3.


-- 
           Summary: Not inited referense.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: alexey dot veselovsky at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39045


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/39045] No warning for uninitialized reference
  2009-01-30 20:50 [Bug c++/39045] New: Not inited referense alexey dot veselovsky at gmail dot com
@ 2009-02-01  5:18 ` bangerth at gmail dot com
  2009-02-01  9:17 ` alexey dot veselovsky at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bangerth at gmail dot com @ 2009-02-01  5:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bangerth at gmail dot com  2009-02-01 05:18 -------
Confirmed.


-- 

bangerth at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2009-02-01 05:18:12
               date|                            |
            Summary|Not inited referense.       |No warning for uninitialized
                   |                            |reference


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39045


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/39045] No warning for uninitialized reference
  2009-01-30 20:50 [Bug c++/39045] New: Not inited referense alexey dot veselovsky at gmail dot com
  2009-02-01  5:18 ` [Bug c++/39045] No warning for uninitialized reference bangerth at gmail dot com
@ 2009-02-01  9:17 ` alexey dot veselovsky at gmail dot com
  2009-02-06  2:42 ` [Bug c++/39045] uninitialized reference in struct with operator new is not erroring out pinskia at gcc dot gnu dot org
  2009-04-29 15:35 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: alexey dot veselovsky at gmail dot com @ 2009-02-01  9:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from alexey dot veselovsky at gmail dot com  2009-02-01 09:17 -------
I think it should be error, not warning. (comeau and ms vc claims it as error)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39045


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/39045] uninitialized reference in struct with operator new is not erroring out
  2009-01-30 20:50 [Bug c++/39045] New: Not inited referense alexey dot veselovsky at gmail dot com
  2009-02-01  5:18 ` [Bug c++/39045] No warning for uninitialized reference bangerth at gmail dot com
  2009-02-01  9:17 ` alexey dot veselovsky at gmail dot com
@ 2009-02-06  2:42 ` pinskia at gcc dot gnu dot org
  2009-04-29 15:35 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-02-06  2:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2009-02-06 02:41 -------
This is looks like PR 29039.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|diagnostic                  |accepts-invalid
            Summary|No warning for uninitialized|uninitialized reference in
                   |reference                   |struct with operator new is
                   |                            |not erroring out


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39045


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/39045] uninitialized reference in struct with operator new is not erroring out
  2009-01-30 20:50 [Bug c++/39045] New: Not inited referense alexey dot veselovsky at gmail dot com
                   ` (2 preceding siblings ...)
  2009-02-06  2:42 ` [Bug c++/39045] uninitialized reference in struct with operator new is not erroring out pinskia at gcc dot gnu dot org
@ 2009-04-29 15:35 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-29 15:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2009-04-29 15:35 -------
*** Bug 39963 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |asmprog32 at hotmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39045


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-04-29 15:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-30 20:50 [Bug c++/39045] New: Not inited referense alexey dot veselovsky at gmail dot com
2009-02-01  5:18 ` [Bug c++/39045] No warning for uninitialized reference bangerth at gmail dot com
2009-02-01  9:17 ` alexey dot veselovsky at gmail dot com
2009-02-06  2:42 ` [Bug c++/39045] uninitialized reference in struct with operator new is not erroring out pinskia at gcc dot gnu dot org
2009-04-29 15:35 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).