Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!apple!voder!procase!roger From: roger@procase.UUCP (Roger H. Scott) Newsgroups: comp.lang.c++ Subject: Re: Will C++ 2.1 fix the virtual function linkage problem? Message-ID: <160@logo.procase.UUCP> Date: 3 Jun 90 03:44:42 GMT References: Reply-To: roger@procase.UUCP (Roger H. Scott) Distribution: comp Organization: PROCASE Corporation, Santa Clara, CA Lines: 35 In article dove@batman.uucp (Webster &) writes: >The problem: (paraphrased somewat -rhs) > >Suppose a user of a library (e.g. InterViews) has redefined many virtual >functions from the library. Now assume that a new release of the >library comes out and the type signature for some of these functions is changed, > and the user is not fully aware of the change. > >This causes the derived class virtual functions to "fail to link" with >the base class declarations leading to program failure. There is no >compile time warning since the derived virtual declarations are now >treated as new function members starting at the derived class level. 1. This is not a language definition issue, requiring a language change. It is a compiler design issue, requiring a compiler change. 2. The relevant change has been made in the AT&T's 2.0 cfront compiler. In the case you describe you would get a warning that the base class's virtual function(s) have been hidden by the functions in the derived class. Remember that overloading only occurs within a single scope, and the members of a derived class are considered to be in a different scope than the members of a base class. >... >Suppose you allow the derived class to inherit the declaration of the >virtual member. Think about overloading and you will see that things are not nearly as neat and simple as you describe them. @ @ @ @ @ @ @ @ @