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++/25894] [3.4/4.0/4.1/4.2 Regression] conditional operator operating on derived / base pointers appears incorrect



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-01-21 02:32 -------
3.3.3 both accepted the code and did not produce the wrong code.
3.4.0 did produce the correct code but rejected the example in comment #0.
The following code is for the wrong code regression which is produceable in
4.0.0 and above:
#include <stdlib.h>
class base {
        public:
                base() {}
        private:
                int val_;
};

class derived : public base {
        public:
                derived() {}
};

bool x = true ? (derived*)0 : (base*)0;

int main ()
{
  if (x)
    abort();
}

----

I am starting to think the wrong code is a different regression than the
rejects valid.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code


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


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