Title
Fix for "needed for constant evaluation"
Status
c++23
Section
7.7 [expr.const]
Submitter
US

Created on 2022-11-03.00:00:00 last changed 17 months ago

Messages

Date: 2022-11-08.20:14:51

Proposed resolution (approved by CWG 2022-11-08):

  1. Change in 7.7 [expr.const] paragraph 3 as follows:

    A variable is potentially-constant if it is constexpr or it has reference or non-volatile const-qualified integral or enumeration type.
  2. Change in 7.7 [expr.const] paragraph 16.7 as follows:

    A function or variable is needed for constant evaluation if it is:
    • a constexpr function that is named by an expression (6.3) that is potentially constant evaluated, or
    • a potentially-constant variable named by a potentially constant evaluated expression that is either a constexpr variable or is of non-volatile const-qualified integral type or of reference type.
Date: 2022-11-27.21:00:25
P2720R0 comment USĀ 17-047

[Accepted as a DR at the November, 2022 meeting.]

The criteria for a variable to be needed for constant evaluation are inconsistent with those for it to be usable in constant expressions (/4).

History
Date User Action Args
2023-07-16 13:00:43adminsetstatus: open -> c++23
2023-07-16 13:00:43adminsetstatus: drwp -> open
2023-02-18 18:43:04adminsetstatus: dr -> drwp
2022-11-25 05:14:04adminsetstatus: nb -> dr
2022-11-08 20:14:51adminsetmessages: + msg6984
2022-11-08 20:13:50adminsetstatus: review -> nb
2022-11-08 20:13:50adminsetstatus: review -> review
2022-11-08 20:13:50adminsetstatus: review -> review
2022-11-08 20:13:50adminsetstatus: review -> review
2022-11-08 20:13:50adminsetstatus: review -> review
2022-11-08 20:13:50adminsetstatus: review -> review
2022-11-08 07:28:43adminsetstatus: nb -> review
2022-11-08 07:28:43adminsetstatus: nb -> nb
2022-11-08 07:28:43adminsetstatus: nb -> nb
2022-11-08 07:28:43adminsetstatus: open -> nb
2022-11-08 07:28:43adminsetstatus: open -> open
2022-11-03 00:00:00admincreate