www.digitalmars.com         C & C++   DMDScript  

c++ - Strange classes error

reply "Slava Uvarov" <slavau softcontrol.hu> writes:
I've found strange error message for the next small piece of code:
All other compilers I tested (VC++, gcc, Compaq UNIX cxx) works well.

class Outer
{
  class Inner_A
  {
  public:
    Inner_A();
    void set();
  };
  class Inner_B: public Inner_A
  {
  public:
    Inner_B();
    void set();
  };
};
void Outer::Inner_A::set() {}

void Outer::Inner_B::set()
{
  Inner_A::set();
}

Inner_A::set();
               ^
..............  : Error: no instance of class 'Outer::Inner_A' for member
'Outer::Inner_A::set'
--- errorlevel 1

But here 'Outer::Inner_A::set'  is only call to base class, it is not
instance!

Thanks, Slava
Feb 15 2002
parent "Walter" <walter digitalmars.com> writes:
You're right, it does look like a bug.

"Slava Uvarov" <slavau softcontrol.hu> wrote in message
news:a4k7d6$26ja$1 digitaldaemon.com...
 I've found strange error message for the next small piece of code:
 All other compilers I tested (VC++, gcc, Compaq UNIX cxx) works well.

 class Outer
 {
   class Inner_A
   {
   public:
     Inner_A();
     void set();
   };
   class Inner_B: public Inner_A
   {
   public:
     Inner_B();
     void set();
   };
 };
 void Outer::Inner_A::set() {}

 void Outer::Inner_B::set()
 {
   Inner_A::set();
 }

 Inner_A::set();
                ^
 ..............  : Error: no instance of class 'Outer::Inner_A' for member
 'Outer::Inner_A::set'
 --- errorlevel 1

 But here 'Outer::Inner_A::set'  is only call to base class, it is not
 instance!

 Thanks, Slava
Feb 16 2002