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

2025-11-07


3117. Overriding by a consteval virtual function

Section: 11.7.3  [class.virtual]     Status: ready     Submitter: Daniel Katz     Date: 2025-11-06

The current prohibition against overriding a non-consteval virtual function by a consteval virtual function (inside a consteval-only type) is too restrictive and prevents implementation of std::meta::exception.

Proposed resolution (approved by CWG 2025-11-06):

Change in 11.7.3 [class.virtual] paragraph 18 as follows:

A class with a consteval virtual function shall not override that overrides a virtual function that is not consteval shall have consteval-only type (6.9.1 [basic.types.general]). A consteval virtual function shall not be overridden by a virtual function that is not consteval.