[Bug c++/48483] New: Construct from yourself w/o warning

lisp2d at lisp2d dot net gcc-bugzilla@gcc.gnu.org
Wed Apr 6 17:38:00 GMT 2011


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

           Summary: Construct from yourself w/o warning
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: lisp2d@lisp2d.net


Simple slip in my program bring to waste the time.

Writing the constructor with arguments of new object bring to crash.
No warnings and deep stillness.

The example to crash:

#include<iostream>
class    B{
public:
    int    x;
};
class    A{
public:
    B&    b;
    A(B&x):b(x){}
};
int    main(void){
    A    a(a.b);
    std::clog<<"a.b.x="<<a.b.x<<std::endl;}



More information about the Gcc-bugs mailing list