[2026-06 LWG Motion 6] P3395R6 (Fix encoding issues and add a formatter for std::error_code)#9129
Open
notdanhan wants to merge 1 commit into
Open
[2026-06 LWG Motion 6] P3395R6 (Fix encoding issues and add a formatter for std::error_code)#9129notdanhan wants to merge 1 commit into
notdanhan wants to merge 1 commit into
Conversation
510ad55 to
4405b34
Compare
eisenwave
suggested changes
Jun 18, 2026
eisenwave
left a comment
Member
There was a problem hiding this comment.
Needs a fair amount of work, mainly converting to \grammarterm.
| Equivalent to: \tcode{return os << ec.category().name() << ':' << ec.value();} | ||
| \end{itemdescr} | ||
|
|
||
| \rSec3[system.error.fmt]{Formatting} |
Member
There was a problem hiding this comment.
It's not your fault, but this subclause stable name makes no sense. Everything else is called [syserr.*] except for [system.error.syn].
We probably want something like [syserr.fmt] or whatever the convention is for "formatting support" stable names.
| \rSec3[system.error.fmt]{Formatting} | ||
| \pnum | ||
| \begin{codeblock} | ||
| template<class charT> struct formatter<error_code, charT> { |
| }; | ||
| \end{codeblock} | ||
|
|
||
| \pnum |
| \pnum | ||
| \effects | ||
| Modifies the state of the \tcode{formatter} to be as if the | ||
| \defnx{error-code-format-spec}{error-code-format-spec!syserr err fmt} passed by the |
Member
There was a problem hiding this comment.
Suggested change
| \defnx{error-code-format-spec}{error-code-format-spec!syserr err fmt} passed by the | |
| \grammarterm{error-code-format-spec} passed by the |
The paper italics are grammarterm italics, not defining.
| last call to \tcode{parse} contained the \tcode{?} option. | ||
| \end{itemdescr} | ||
|
|
||
| \pnum |
| \opt{fill-and-align} \opt{width} \opt{\tcode{?}} \opt{\tcode{s}} | ||
| \end{ncbnf} | ||
|
|
||
| where the productions and \defnx{width}{width!format string} are described in\iref{format.string} |
Member
There was a problem hiding this comment.
Suggested change
| where the productions and \defnx{width}{width!format string} are described in\iref{format.string} | |
| where the productions \grammarterm{fill-and-align} and \grammarterm{width} are described in\iref{format.string}. |
Comment on lines
+1306
to
+1310
| \item If \tcode{charT} is \tcode{char} and the ordinary literal encoding is UTF-8, let | ||
| \tcode{msg} be \tcode{ec.message()} transcoded to UTF-8 with maximal subparts of ill-formed | ||
| subsequences substituted with \unicode{fffd}{replacement character} per the Unicode Standard, Chapter | ||
| 3.9 \unicode{fffd} Substitution in Conversion. | ||
| \item Otherwise, let \tcode{msg} be \tcode{ec.message()} transcoded to an implementation-defined encoding. |
Member
There was a problem hiding this comment.
Needs some reflowing:
Suggested change
| \item If \tcode{charT} is \tcode{char} and the ordinary literal encoding is UTF-8, let | |
| \tcode{msg} be \tcode{ec.message()} transcoded to UTF-8 with maximal subparts of ill-formed | |
| subsequences substituted with \unicode{fffd}{replacement character} per the Unicode Standard, Chapter | |
| 3.9 \unicode{fffd} Substitution in Conversion. | |
| \item Otherwise, let \tcode{msg} be \tcode{ec.message()} transcoded to an implementation-defined encoding. | |
| \item | |
| If \tcode{charT} is \tcode{char} and the ordinary literal encoding is UTF-8, | |
| let \tcode{msg} be \tcode{ec.message()} transcoded to UTF-8 | |
| with maximal subparts of ill-formed subsequences substituted with \unicode{fffd}{replacement character} | |
| per the Unicode Standard, Chapter 3.9 \unicode{fffd} Substitution in Conversion. | |
| \item | |
| Otherwise, let \tcode{msg} be \tcode{ec.message()} | |
| transcoded to an implementation-defined encoding. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #9093
Also Fixes cplusplus/papers#2187