Browse Source

Test when an inherited virtual member is overridden and listed in a derived class's interface definition

This was causing problems because the method is not repeated in the primary vtable (it shows up in the position expected by the base class), but CppAbi does not know that it is inherited until after the impl has been emitted, so it emits the index that it is listed in the derived class.

Note that the generator only does this with virtual destructors (since we never call these virtually).
pull/1/head
Alexander Corrado 14 years ago
parent
commit
ec4699bed2
  1. 4
      tests/Native/InheritanceTests.cpp
  2. 1
      tests/Native/InheritanceTests.h

4
tests/Native/InheritanceTests.cpp

@ -69,6 +69,10 @@ int ClassThatOverridesStuff::BaseNumber () const @@ -69,6 +69,10 @@ int ClassThatOverridesStuff::BaseNumber () const
{
return this->NumberClass::Number ();
}
ClassThatOverridesStuff::~ClassThatOverridesStuff ()
{
this->myNum = 0;
}
NumberClass* ClassThatOverridesStuff::GetInstance (int num, int my)
{
return new ClassThatOverridesStuff (num, my);

1
tests/Native/InheritanceTests.h

@ -50,6 +50,7 @@ protected: @@ -50,6 +50,7 @@ protected:
public:
ClassThatOverridesStuff (int num, int my);
virtual int Number () const;
virtual ~ClassThatOverridesStuff ();
virtual int BaseNumber () const;
static NumberClass* GetInstance (int num, int my);
};

Loading…
Cancel
Save