Movatterモバイル変換


[0]ホーム

URL:


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

2025-12-20


2911. Unclear meaning of expressions "appearing within" subexpressions

Section:7.5.8.1  [expr.prim.req.general]    Status:CD7    Submitter:Hubert Tong    Date:2024-06-24

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

(From submission#562.)

Subclause 7.5.8.1 [expr.prim.req.general] paragraph 2 specifies:

Arequires-expression is a prvalue of type bool whose value isdescribed below. Expressions appearing withinarequirement-body are unevaluated operands(7.2.3 [expr.context]).

Aconstant-expression used as a non-type template argument"appearing within" therequirement-body should not beconsidered an "unevaluated operand". Similarly, bodiesoflambda-expressions should not be in focus of "appearingwithin".

Proposed resolution (approved by CWG 2024-10-11):

  1. Change in 7.2.3 [expr.context] paragraph 1 as follows:

    In some contexts, unevaluated operands appear(7.5.8 [expr.prim.req]7.5.8.2 [expr.prim.req.simple],7.5.8.4 [expr.prim.req.compound], 7.6.1.8 [expr.typeid],7.6.2.5 [expr.sizeof], 7.6.2.7 [expr.unary.noexcept],9.2.9.6 [dcl.type.decltype], 13.1 [temp.pre],13.7.9 [temp.concept]). An unevaluated operand is not evaluated.
  2. Change in 7.5.8.1 [expr.prim.req.general] paragraph 2 as follows:

    Arequires-expression is a prvalue of type bool whose value isdescribed below.Expressions appearing withinarequirement-body are unevaluated operands(7.2.3 [expr.context]).
  3. Change in 7.5.8.2 [expr.prim.req.simple] paragraph 1 as follows:

    Asimple-requirement asserts the validity of an expression.Theexpression is an unevaluated operand.[Note 1: The enclosingrequires-expression will evaluateto false if substitution of template arguments into the expressionfails.The expression is an unevaluated operand(7.2.3 [expr.context]).end note] ...
  4. Change in 7.5.8.4 [expr.prim.req.compound] paragraph 1 as follows:

    Acompound-requirement asserts properties of the expressionE.Theexpression is an unevaluated operand.Substitution of template arguments (if any) and verification ofsemantic properties proceed in the following order:



[8]ページ先頭

©2009-2026 Movatter.jp