Skip to content

[2026-06 LWG Motion 6] P3395R6 (Fix encoding issues and add a formatter for std::error_code)#9129

Open
notdanhan wants to merge 3 commits into
cplusplus:mainfrom
notdanhan:motions-2026-06-lwg-6
Open

[2026-06 LWG Motion 6] P3395R6 (Fix encoding issues and add a formatter for std::error_code)#9129
notdanhan wants to merge 3 commits into
cplusplus:mainfrom
notdanhan:motions-2026-06-lwg-6

Conversation

@notdanhan

Copy link
Copy Markdown

Fixes: #9093
Also Fixes cplusplus/papers#2187

@notdanhan notdanhan force-pushed the motions-2026-06-lwg-6 branch from 510ad55 to 4405b34 Compare June 14, 2026 19:06

@eisenwave eisenwave left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a fair amount of work, mainly converting to \grammarterm.

Comment thread source/diagnostics.tex Outdated
Comment thread source/diagnostics.tex
Comment thread source/diagnostics.tex Outdated
Comment thread source/diagnostics.tex Outdated
Comment thread source/diagnostics.tex Outdated
Comment thread source/diagnostics.tex Outdated
Comment thread source/diagnostics.tex Outdated
@jensmaurer jensmaurer requested a review from eisenwave June 20, 2026 18:43

@eisenwave eisenwave left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things are clearly wrong, but I could use some advice from @jensmaurer on the multi-paragraph \effects thing.

Comment thread source/diagnostics.tex
\end{ncbnf}

where the productions and \fmtgrammarterm{fill-and-align} and \fmtgrammarterm{width} are
described in\iref{format.string}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
described in\iref{format.string}.
described in \ref{format.string}.

Comment thread source/diagnostics.tex
\begin{itemize}
\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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let \tcode{msg} be \tcode{ec.message()} transcoded to UTF-8
then let \tcode{msg} be \tcode{ec.message()} transcoded to UTF-8

Comment thread source/diagnostics.tex
Comment on lines +1317 to +1323

\pnum
Otherwise, let \tcode{msg} be \tcode{std::format("{}:{}", ec.category().name(), ec.value())}.

\pnum
If the \tcode{?} option is used then \tcode{msg} is formatted as an escaped string(\iref{format.string.escaped}).
Writes \tcode{msg} into \tcode{ctx.out()}, adjusted according to the \fmtgrammarterm{error-code-format-spec}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all seems to be a scription of Effects to me, not separate paragraphs, but maybe I'm missing something. The paper does put gaps here, but idk, this is weird.

Suggested change
\pnum
Otherwise, let \tcode{msg} be \tcode{std::format("{}:{}", ec.category().name(), ec.value())}.
\pnum
If the \tcode{?} option is used then \tcode{msg} is formatted as an escaped string(\iref{format.string.escaped}).
Writes \tcode{msg} into \tcode{ctx.out()}, adjusted according to the \fmtgrammarterm{error-code-format-spec}.
Otherwise, let \tcode{msg} be \tcode{std::format("{}:{}", ec.category().name(), ec.value())}.
If the \tcode{?} option is used then \tcode{msg} is formatted as an escaped string(\iref{format.string.escaped}).
Writes \tcode{msg} into \tcode{ctx.out()}, adjusted according to the \fmtgrammarterm{error-code-format-spec}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do have multi-paragraph \effects in some places, but having a separate paragraph for every sentence is certainly non-optimal.

Comment thread source/diagnostics.tex
Otherwise, let \tcode{msg} be \tcode{std::format("{}:{}", ec.category().name(), ec.value())}.

\pnum
If the \tcode{?} option is used then \tcode{msg} is formatted as an escaped string(\iref{format.string.escaped}).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If the \tcode{?} option is used then \tcode{msg} is formatted as an escaped string(\iref{format.string.escaped}).
If the \tcode{?} option is used
then \tcode{msg} is formatted as an escaped string\iref{format.string.escaped}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants