Title
Confusing reference to the length of a user-defined string literal
Status
cd2
Section
5.13.8 [lex.ext]
Submitter
Alisdair Meredith

Created on 2009-07-06.00:00:00 last changed 143 months ago

Messages

Date: 2010-03-15.00:00:00

[Voted into WP at March, 2010 meeting.]

Date: 2009-10-15.00:00:00

Proposed resolution (October, 2009):

Change 5.13.8 [lex.ext] paragraph 5 as follows:

If L is a user-defined-string-literal, let str be the literal without its ud-suffix and let len be the number of characters (or code points) code units in str (i.e., its length excluding the terminating null character)...
Date: 2009-07-06.00:00:00

5.13.8 [lex.ext] paragraph 5 says,

If L is a user-defined-string-literal, let str be the literal without its ud-suffix and let len be the number of characters (or code points) in str (i.e., its length excluding the terminating null character).

The length of a null-terminated string is defined in 16.3.3.3.5.2 [byte.strings] as the number of bytes preceding the terminator, but a single code point in a UTF-8 string can require more than one byte, so this sentence is inconsistent and needs to be revised to make clear which definition is in view.

History
Date User Action Args
2010-03-29 00:00:00adminsetmessages: + msg2654
2010-03-29 00:00:00adminsetstatus: ready -> cd2
2009-11-08 00:00:00adminsetmessages: + msg2336
2009-11-08 00:00:00adminsetstatus: open -> ready
2009-07-06 00:00:00admincreate