Title
Pure virtual must be defined when implicitly called
Status
cd1
Section
11.7.4 [class.abstract]
Submitter
Daniel Frey

Created on 2002-11-14.00:00:00 last changed 26 months ago

Messages

Date: 2004-03-15.00:00:00

[Voted into WP at March 2004 meeting.]

Date: 2022-02-18.07:47:23

Proposed resolution:

Change 11.7.4 [class.abstract] paragraph 2 from

A pure virtual function need be defined only if explicitly called with the qualified-id syntax (_N4567_.5.1.1 [expr.prim.general]).

to

A pure virtual function need be defined only if explicitly called with, or as if with (11.4.7 [class.dtor]), the qualified-id syntax (_N4567_.5.1.1 [expr.prim.general]).

Note: 11.4.7 [class.dtor] paragraph 6 defines the "as if" cited.

Date: 2022-02-18.07:47:23

In 11.7.4 [class.abstract] paragraph 2, it reads:

A pure virtual function need be defined only if explicitly called with the qualified-id syntax (_N4567_.5.1.1 [expr.prim.general]).

This is IMHO incomplete. A dtor is a function (well, a "special member function", but this also makes it a function, right?) but it is called implicitly and thus without a qualified-id syntax. Another alternative is that the pure virtual function is called directly or indirectly from the ctor. Thus the above sentence which specifies when a pure virtual function need be defined ("...only if...") needs to be extended:

A pure virtual function need be defined only if explicitly called with the qualified-id syntax (_N4567_.5.1.1 [expr.prim.general]) or if implicitly called (11.4.7 [class.dtor] or 11.9.5 [class.cdtor]).
History
Date User Action Args
2022-02-18 07:47:23adminsetmessages: + msg6686
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2004-04-09 00:00:00adminsetmessages: + msg1016
2004-04-09 00:00:00adminsetstatus: ready -> wp
2003-11-15 00:00:00adminsetstatus: review -> ready
2003-04-25 00:00:00adminsetstatus: open -> review
2002-11-14 00:00:00admincreate