Re: BUG: compiler allows for creation of objects without destructor compiled

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Edward Diener (eddielee_at_tropicsoft.com)
Date: 04/09/04


Date: Thu, 8 Apr 2004 22:01:20 -0400

Carl Daniel [VC++ MVP] wrote:
> Maxim Yegorushkin wrote:
>>
>> So, are MS compiler guys going to fix it?
>
> It's already fixed in Whidbey ("VC8").
>
>> cl -c -EHs privatedest0408.cpp
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.40309
> for 80x86 Copyright (C) Microsoft Corporation. All rights reserved.
>
> privatedest0408.cpp
> privatedest0408.cpp(8) : warning C4624: 'derived' : destructor could
> not be generated because a base class destructor is inaccessible
> privatedest0408.cpp(14) : error C2248: 'base::~base' : cannot access
> private member declared in class 'base'
> privatedest0408.cpp(5) : see declaration of 'base::~base'
> privatedest0408.cpp(3) : see declaration of 'base'
> This diagnostic occurred in the compiler generated function
> 'derived::~derived(void)'
>
> Since there's an easy workaround (just don't write illegal code) it's
> unlikely that this will be fixed in any other form (patch, service
> pack, etc) before Whidbey ships ("1st half of 2005" is the latest
> official word).

You say that as if you believe that if a serious some bug has no easy
workaround it is likely that it will be fixed before Whidbey ships <g> .



Relevant Pages

  • Re: C# Override limitation..why?
    ... > override so why can't it look for base.whateverin the base class? ... > look for methods in the base class where the signature parameters match ... It's not that the compiler ... static dispatch based on expression type. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: the virtual keyword
    ... > you could not declare a body for it in the class it was declared virtual, ... This class can only be used as a base class, ... would result in a compiler error. ... function pointer that is added to the actual class. ...
    (comp.lang.cpp)
  • Compiler Error Message: BC31019
    ... Compiler Warning Messages: ... Warning: BC40003: property 'Profile' shadows an overloadable member ... overloadable member declared in the base class 'Default2'. ... to overload the base method, this method must be declared 'Overloads'. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Reference to an undefined assignment operator of a base class in a derived class.
    ... As you can see in the base class there is no an assignment operator defined ... However in the derived class there is explicit reference to the ... The Microsoft compiler VC++ 2005 EE compiles the code without any error. ...
    (microsoft.public.vc.language)
  • Re: Some thoughts about OO programming
    ... type code which is exactly what polymorphism is supposed to help fix. ... in general that's called the fragile base class problem. ... interface IAnimal2: public IAnimal ... reasons to avoid it, many of which you address in your post. ...
    (comp.programming)