[Bug c++/25894] [3.4/4.0/4.1/4.2 Regression] conditional operator operating on derived / base pointers appears incorrect
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sat Jan 21 02:32:00 GMT 2006
------- 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
More information about the Gcc-bugs
mailing list