www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Strange classes error

↑ ↓ ← "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
↑ ↓ → "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