Section: 184.108.40.206 [support.srcloc.cons] Status: C++20 Submitter: Jens Maurer Opened: 2020-02-13 Last modified: 2021-02-25 10:48:01 UTC
View all issues with C++20 status.
Addresses DE 169
The expectation of the note that a default argument expression involving current() causes a source_location to be constructed that refers to the site of a function call where that default argument is needed has no basis in normative text. In particular, 220.127.116.11 paragraph 5 seems to imply that the name "current" and its semantics are bound where it appears lexically in the function declaration.Proposed change: Add normative text to express the desired semantics.
[2020-02 Moved to Immediate on Thursday afternoon in Prague.]
This wording is relative to N4849.
Modify 18.104.22.168 [support.srcloc.cons] as indicated:
static consteval source_location current() noexcept;
-1- […]-2- Remarks:
When a default member initializer is used to initialize a non-static data member, any calls to currentshould correspond to the location of the constructor or aggregate initialization that initializes the member. -3- [Note: When used as a default argument (22.214.171.124 [dcl.fct.default]), the value of the source_location will be the location of the call to current at the call site. — end note]