Created on 2022-11-09.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4917.
Modify [format.parse.ctx] as indicated:
constexpr size_t next_arg_id();-7- Effects: If indexing_ != manual is true, equivalent to:
if (indexing_ == unknown) indexing_ = automatic; return next_arg_id_++;-8- Throws: format_error if indexing_ == manual is true which indicates mixing of automatic and manual argument indexing.
-?- Remarks: Let cur-arg-id be the value of next_arg_id_ prior to this call. Call expressions where cur-arg-id >= num_args_ is true are not core constant expressions ([expr.const]).
constexpr size_t check_arg_id(size_t id);-9- Effects: If indexing_ != automatic is true, equivalent to:
if (indexing_ == unknown) indexing_ = manual;-10- Throws: format_error if indexing_ == automatic is true which indicates mixing of automatic and manual argument indexing.
-11- Remarks: Call expressions where id >= num_args_ is true are not core constant expressions ([expr.const]).
[ 2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Voting → WP. ]
[ Kona 2022-11-11; move to Ready ]
[ 2022-11-11; Tomasz provide improved wording; Move to Open ]
Clarify that the value of next_arg_id_ is used, and add missing "is true."
The definition of check_arg_id in [format.parse.ctx] includes a (compile-time) argument id check in the Remarks element:
constexpr void check_arg_id(size_t id);[…]
Remarks: Call expressions where id >= num_args_ are not core constant expressions ([expr.const]).
However, a similar check is missing from next_arg_id which means that there is no argument id validation in user-defined format specification parsing code that invokes this function (e.g. when parsing automatically indexed dynamic width).
Previous resolution [SUPERSEDED]:
This wording is relative to N4917.
Modify [format.parse.ctx] as indicated:
constexpr size_t next_arg_id();-7- Effects: If indexing_ != manual, equivalent to:
if (indexing_ == unknown) indexing_ = automatic; return next_arg_id_++;-8- Throws: format_error if indexing_ == manual which indicates mixing of automatic and manual argument indexing.
-?- Remarks: Call expressions where next_arg_id_ >= num_args_ are not core constant expressions ([expr.const]).
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2023-02-13 10:17:57 | admin | set | messages: + msg13363 |
2023-02-13 10:17:57 | admin | set | status: voting -> wp |
2023-02-06 15:33:48 | admin | set | status: ready -> voting |
2022-11-11 21:14:29 | admin | set | messages: + msg13027 |
2022-11-11 21:14:29 | admin | set | messages: + msg13026 |
2022-11-11 21:14:29 | admin | set | status: open -> ready |
2022-11-11 12:47:05 | admin | set | status: new -> open |
2022-11-09 16:27:45 | admin | set | messages: + msg12979 |
2022-11-09 00:00:00 | admin | create |