diff --git a/xml/issue4591.xml b/xml/issue4591.xml index a24d43e392..ed3e4b2f8a 100644 --- a/xml/issue4591.xml +++ b/xml/issue4591.xml @@ -10,12 +10,12 @@

-`std::meta::current_function` is specified to throw if CURRENT-SCOPE(P) -does not represent a function. It is implied that `current_function` throws if the call is +`std::meta::current_function` is specified to throw if CURRENT-SCOPE(P) +does not represent a function. It is implied that `current_function` throws if the call is directly contained in a local class, in which case it's actually in a function body, but indirectly.

-This might be an oversight, as neither (which introduced this function) nor -https://wg21.link/P3795/github has any discussion +This might be an oversight, as neither (which introduced this function) nor +https://wg21.link/P3795/github has any discussion concerning local classes.

Example: @@ -48,14 +48,14 @@ consteval info current_function();

--6- An invocation of `current_function` that appears at a program point P -is value-dependent () if eval-point(P) +-6- An invocation of `current_function` that appears at a program point P +is value-dependent () if eval-point(P) is enclosed by a scope corresponding to a templated entity.

--7- Let S be CURRENT-SCOPE(P), where P +-7- Let S be CURRENT-SCOPE(P), where P is the point at which the invocation of `current_function` lexically appears.

--8- Returns: S if S represents a function. Otherwise, +-8- Returns: S if S represents a function. Otherwise, parent_of(S).

-9- Throws: `meta::exception` unless S represents a function. @@ -77,6 +77,46 @@ Set priority to 2 after reflector poll.

"we should say this in words, similar to `current_namespace`."

+ +

+This wording is relative to . +

+ +
    +
  1. +

    Modify as indicated:

    + +
    +
    +consteval info current_function();
    +
    +
    +

    +-6- An invocation of `current_function` that appears at a program point P +is value-dependent () if eval-point(P) +is enclosed by a scope corresponding to a templated entity. +

    +-7- Let S be CURRENT-SCOPE(P), where P +is the point at which the invocation of `current_function` lexically appears. +

    +-8- Returns: S if S represents a function. +Otherwise, a reflection representing the nearest enclosing +function of the entity represented by S. +

    +-9- Throws: `meta::exception` unless S represents a +functionan enclosing function is found. +

    +
    +
    + +
  2. + +
+
+ +2026-09-11; Tim provides new wording +

The invented lambdas from consteval-block-declarations need to be ignored.

+ @@ -94,19 +134,19 @@ consteval info current_function();

--6- An invocation of `current_function` that appears at a program point P -is value-dependent () if eval-point(P) +-6- An invocation of `current_function` that appears at a program point P +is value-dependent () if eval-point(P) is enclosed by a scope corresponding to a templated entity.

--7- Let S be CURRENT-SCOPE(P), where P +-7- Let S be CURRENT-SCOPE(P), where P is the point at which the invocation of `current_function` lexically appears.

--8- Returns: S if S represents a function. +-8- Returns: S if S represents a function. Otherwise, a reflection representing the nearest enclosing -function of the entity represented by S. +function of the entity represented by S, ignoring any function call operators of closure types introduced by consteval-block-declarations ().

--9- Throws: `meta::exception` unless S represents a -functionan enclosing function is found. +-9- Throws: `meta::exception` unlessif S does not representrepresents a +function and an enclosing function is not found.