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: unassig...@gcc.gnu.org
        ReportedBy: lis...@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;}

Reply via email to