CWG Issue 1293 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-05
1293. String literals in constant expressions
Section: 7.7 [expr.const]Status: CD3Submitter: Daniel KrüglerDate: 2011-04-11
[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]
It is not clear whether a string literal can be used in a constant expression.
Proposed resolution (August, 2011):
Change 7.7 [expr.const] paragraph 2 as follows:
- an lvalue-to-rvalue conversion (7.3.2 [conv.lval]) unless it is applied to
- a glvalue of integral or enumeration type that refers to a non-volatile const object with a preceding initialization, initialized with a constant expression [_Note:_ a string literal (5.13.5 [lex.string]) corresponds to an array of such objects. —_end note_], or
- ...