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++/38622] operator ?: Does not check identity of types



------- Comment #5 from lisp2d at lisp2d dot net  2008-12-25 14:36 -------
Let's start from the beginning.

class   A{public:int    x;A():x(0){};};
class   B:public        A{public:int    y;B():A(),y(0){};};
class   C:public        A{public:int    z;C():A(),z(0){};};

B       xb;
C       xc;

A&      debug1(){
        return  (false?xb:xc);} // an error

A&      debug2(){
        if(false)
                return  xb;     //good
        else
                return  xc;}    //good

It is desirable to remove an error message.


-- 


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


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