Title
Function contract assertions are needed for pure virtual function calls
Status
open
Section
9.4.1 [dcl.contract.func]
Submitter
Joshua Berne

Created on 2026-09-06.00:00:00 last changed 1 week ago

Messages

Date: 2026-09-22.18:59:31

Suggested resolution:

Change in 9.4.1 [dcl.contract.func] paragraph 9 as follows:

The function contract assertions of a function are considered to be needed (13.9.2 [temp.inst]) when
  • the function is odr-used (6.3 [basic.def.odr]) or a virtual function,
  • the function is selected by overload resolution (12.2 [over.match], 12.3 [over.over]) where the function call is a potentially evaluated expression, or
  • the function is defined.
Date: 2026-09-06.00:00:00

(From submission #1003.)

With P3097R3 (Contracts for C++: Virtual functions), adopted in June, 2026, function contract assertions are now required to be instantiated in cases where a pure virtual function is called, even when the function is not odr-used.

History
Date User Action Args
2026-09-20 19:38:27adminsetmessages: + msg8687
2026-09-06 00:00:00admincreate