Title
Function parameters of consteval-only type
Status
ready
Section
6.9.1 [basic.types.general]
Submitter
Hubert Tong

Created on 2025-10-29.00:00:00 last changed 1 month ago

Messages

Date: 2025-11-05.12:07:23

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

  1. Change in 6.9.1 [basic.types.general] paragraph 12 as follows:

    A type is consteval-only if it is either std::meta::info or a type compounded from a consteval-only type (6.9.4 [basic.compound]). Every object of consteval-only type shall be
    • the object associated with a constexpr variable or a subobject thereof,
    • a template parameter object (13.2 [temp.param]) or a subobject thereof, or
    • an object whose lifetime begins and ends during the evaluation of a core constant expression.
    Every function of consteval-only type shall be an immediate function (7.7 [expr.const]).
  2. Change in 7.7 [expr.const] paragraph 27 as follows:

    An immediate function is a function that is either
    • declared with the consteval specifier, or
    • an immediate-escalating function whose type is consteval-only (6.9.1 [basic.types.general]), or
    • an immediate-escalating function F whose function body contains either
      • an immediate-escalating expression or
      • a definition of a non-constexpr variable with consteval-only type
      whose innermost enclosing non-block scope is F 's function parameter scope. [Note 11: Default member initializers used to initialize a base or member subobject (11.9.3 [class.base.init]) are considered to be part of the function body (9.6.1 [dcl.fct.def.general]). —end note]
    ...
Date: 2025-10-29.00:00:00

The properties of functions with consteval-only parameters are unclear.

History
Date User Action Args
2025-11-07 22:16:49adminsetstatus: tentatively ready -> ready
2025-11-05 12:07:23adminsetstatus: open -> tentatively ready
2025-11-04 07:34:33adminsetmessages: + msg8205
2025-10-29 00:00:00admincreate