Created on 2015-01-12.00:00:00 last changed 95 months ago
Proposed resolution (September, 2015):
Change 11.4.7 [class.dtor] paragraph 6 as follows:
A destructor that is defaulted and not defined as deleted is implicitly defined when it is odr-used (6.3 [basic.def.odr])to destroy an object of its class type (6.7.6 [basic.stc])or when it is explicitly defaulted after its first declaration.
[Adopted at the February, 2016 meeting.]
The rules in 6.3 [basic.def.odr] and 11.4.7 [class.dtor] do not specify when the destructor for B can/must be defined:
struct A { virtual ~A(); }; struct B : A {}; int main() { A *p = new B; delete p; }
An implementation should be allowed, but not required, to implicitly define a virtual special member function at any point where it has been desclared, as well as being required to define it as described in 11.4.7 [class.dtor] paragraph 6, etc.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: tentatively ready -> cd4 |
2015-11-10 00:00:00 | admin | set | messages: + msg5605 |
2015-11-10 00:00:00 | admin | set | status: drafting -> tentatively ready |
2015-01-12 00:00:00 | admin | create |