Created on 2022-11-07.00:00:00 last changed 27 months ago
Proposed resolution (approved by CWG 2022-11-10):
Change in 5.13.1 [lex.literal.kinds] paragraph 1 as follows:
There are several kinds of literals. [ Footnote: ... ]
literal:
integer-literal
character-literal
floating-point-literal
string-literal
boolean-literal
pointer-literal
user-defined-literal
[ Note: When appearing as an expression, a literal has a
type and a value category (7.5.2 [expr.prim.literal]). -- end note
]
Change in 5.13.2 [lex.icon] paragraph 3 as follows:
The type of an integer-literal is the first type in the list in Table 9 corresponding to its optional integer-suffix in which its value can be represented.An integer-literal is a prvalue.
Change in 5.13.7 [lex.bool] paragraph 1 as follows:
The Boolean literals are the keywords false and true. Such literalsare prvalues andhave type bool.
Change in 5.13.8 [lex.nullptr] paragraph 1 as follows:
The pointer literal is the keyword nullptr. Itis a prvalue ofhas type std::nullptr_t.
[Accepted as a DR at the November, 2022 meeting.]
Subclause 7.5.2 [expr.prim.literal] paragraph 1 specifies:
... A string-literal is an lvalue designating a corresponding string literal object (5.13.5 [lex.string]), a user-defined-literal has the same value category as the corresponding operator call expression described in 5.13.9 [lex.ext], and any other literal is a prvalue.
Yet, there is redundant specification in 5.13.2 [lex.icon] paragraph 3:
The type of an integer-literal is the first type in the list in Table 9 corresponding to its optional integer-suffix in which its value can be represented. An integer-literal is a prvalue.
And in 5.13.7 [lex.bool] paragraph 1:
The Boolean literals are the keywords false and true. Such literals are prvalues and have type bool.
And in 5.13.8 [lex.nullptr] paragraph 1:
The pointer literal is the keyword nullptr. It is a prvalue of type std::nullptr_t.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2023-07-16 13:00:43 | admin | set | status: open -> c++23 |
| 2023-07-16 13:00:43 | admin | set | status: drwp -> open |
| 2023-02-18 18:43:04 | admin | set | status: dr -> drwp |
| 2022-11-25 05:14:04 | admin | set | status: ready -> dr |
| 2022-11-12 03:50:17 | admin | set | messages: + msg7004 |
| 2022-11-09 21:43:53 | admin | set | status: open -> ready |
| 2022-11-09 21:43:53 | admin | set | status: open -> open |
| 2022-11-09 21:43:53 | admin | set | status: open -> open |
| 2022-11-09 21:43:53 | admin | set | status: open -> open |
| 2022-11-07 12:52:03 | admin | set | status: ready -> open |
| 2022-11-07 12:52:03 | admin | set | status: ready -> ready |
| 2022-11-07 12:52:03 | admin | set | status: ready -> ready |
| 2022-11-07 00:00:00 | admin | create | |