Movatterモバイル変換


[0]ホーム

URL:


This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-11-05


390. Pure virtual must be defined when implicitly called

Section:11.7.4  [class.abstract]    Status:CD1    Submitter:Daniel Frey    Date:14 Nov 2002

[Voted into WP at March 2004 meeting.]

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

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

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

A pure virtual function need be defined only if explicitly called withthe qualified-id syntax (_N4567_.5.1.1 [expr.prim.general]) or if implicitlycalled (11.4.7 [class.dtor] or 11.9.5 [class.cdtor]).

Proposed resolution:

Change 11.7.4 [class.abstract] paragraph 2 from

A pure virtual function need be defined only if explicitly calledwith thequalified-id syntax (_N4567_.5.1.1 [expr.prim.general]).

to

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

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




[8]ページ先頭

©2009-2025 Movatter.jp