95. Members added by the implementation

Section: 20.5.5.5 [member.functions] Status: NAD Submitter: AFNOR Opened: 1998-10-07 Last modified: 2016-02-10

Priority: Not Prioritized

View other active issues in [member.functions].

View all other issues in [member.functions].

View all issues with NAD status.

Discussion:

In 17.3.4.4/2 vs 17.3.4.7/0 there is a hole; an implementation could add virtual members a base class and break user derived classes.

Example:

// implementation code:
struct _Base { // _Base is in the implementer namespace
        virtual void foo ();
};
class vector : _Base // deriving from a class is allowed
{ ... };

// user code:
class vector_checking : public vector 
{
        void foo (); // don't want to override _Base::foo () as the 
                     // user doesn't know about _Base::foo ()
};

Proposed resolution:

Clarify the wording to make the example illegal.

Rationale:

This is not a defect in the Standard.  The example is already illegal.  See 20.5.5.5 [member.functions] paragraph 2.