This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25894] [3.4/4.0/4.1/4.2 Regression] conditional operator operating on derived / base pointers appears incorrect
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jan 2006 02:32:08 -0000
- Subject: [Bug c++/25894] [3.4/4.0/4.1/4.2 Regression] conditional operator operating on derived / base pointers appears incorrect
- References: <bug-25894-11686@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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