Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

US 3-030 5.2p1 [lex.phases] new-lines after phase 1 #475

Closed
wg21bot opened this issue Oct 30, 2022 · 2 comments · Fixed by cplusplus/draft#5988
Closed

US 3-030 5.2p1 [lex.phases] new-lines after phase 1 #475

wg21bot opened this issue Oct 30, 2022 · 2 comments · Fixed by cplusplus/draft#5988
Labels
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Oct 30, 2022

Translation phases 2 and 3 assume that lines are terminated by “new-line characters”. However, the current specification of phase 1 does not guarantee that to be true. In particular, for a UTF-8 file the verbatim sequence of source file characters forms the input for phase 2, even on systems where the line terminator is a carriage return. The non-UTF-8 specification is also defective in that it speaks of “introducing” new-line characters, even for encodings like Latin-1 where new-lines might already be present and no “introduction” is needed or appropriate.

Proposed change:

If an input file is determined to be a UTF-8 file, then it shall be a well-formed UTF-8 code unit sequence and it is decoded to produce a sequence of UCS scalar values that constitutes the sequence of elements of the translation character set, representing each line-termination character or character sequence as a new-line character.
For any other kind of input file supported by the implementation, characters are mapped, in an implementation-defined manner, to a sequence of translation character set elements (5.3) (introducing new-line characters for representing end-of-line indicators as new-line characters).

@wg21bot wg21bot changed the title US 5.2p1 [lex.phases] US 5.2p1 [lex.phases] new-lines after phase 1 Oct 30, 2022
@wg21bot wg21bot added the CWG Core label Oct 31, 2022
@jensmaurer jensmaurer changed the title US 5.2p1 [lex.phases] new-lines after phase 1 US 3-030 5.2p1 [lex.phases] new-lines after phase 1 Nov 3, 2022
@jensmaurer jensmaurer transferred this issue from another repository Nov 3, 2022
@jensmaurer jensmaurer added this to the CD C++23 milestone Nov 3, 2022
@jensmaurer
Copy link
Member

CWG2639

@jensmaurer
Copy link
Member

CWG 2022-11-08: Accept with Modifications. See CWG2639 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants