[Bug c++/14017] New: Problem on gcc 3.4 with multiple inheritance having a common base
Franck dot Vedrine at cea dot fr
gcc-bugzilla@gcc.gnu.org
Wed Feb 4 13:38:00 GMT 2004
Multiple inheritance does not execute correctly on the following code : it
cores dump. It is specific on gcc 3.4. The code works fine on gcc 3.3
#include <iostream>
class Base {
public:
virtual ~Base() {}
virtual int value() const { return 0; }
};
class FstDerived : public Base {
public:
virtual int _fst() const { return 1; }
int fst() const { return _fst(); }
};
class SndDerived : public Base {
public:
virtual int _snd() const { return 2; }
int snd() const { return _snd(); }
};
class Final : public FstDerived, public SndDerived {
protected:
virtual int _snd() const { return SndDerived::_snd() + 2; }
public:
int snd() const { return SndDerived::snd(); }
};
int main() {
FstDerived* pfdFst = new Final();
std::cout << ((const Final&) *pfdFst).snd() << std::endl;
};
--
Summary: Problem on gcc 3.4 with multiple inheritance having a
common base
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Franck dot Vedrine at cea dot fr
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: gcc version 3.4.0 20040128 (prerelease)
GCC host triplet: i686-pc-cygwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14017
More information about the Gcc-bugs
mailing list