This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Fix libstdc++/5708
Nathan Myers wrote:
>
...
> >
> > It didn't occur to me that the two could be treated differently,
> > especially since the Note in 22.2.6.2.2, p2 goes on to say:
> >
> > ...For the value af equal to (str.flags() & str.adjustfield),
> > if (af ==str.internal) is true, the fill characters are placed
> > where none or space appears in the formatting pattern; ...
> >
> > Or am I still missing something?
>
> I don't know. It seems perfectly clear to me that one part of the
> document says that a space appears in the format, and a different part
> of the document describes adding fill characters if the format _including_
> the space isn't long enough. I don't see any text saying to take the
> space out, or to replace it with one or more fill characters. It just
> says where to insert your fill characters.
So what you're saying is that the Note in 22.2.6.2.2, p2 really means:
"insert a single space (i.e., the result of widen (' ')) where space
appears in the pattern and pad the rest with the fill character up to
the requested width." That's not how I read it but I'll trust your
interpretation. Given that other implementers apparently misread the
Note the same way I did, it might help to clarify it.
How about changing the sentence in 22.2.6.2.2, p2 from
...For the value af equal to (str.flags() & str.adjustfield),
if (af == str.internal) is true, the fill characters are placed
where none or space appears in the formatting pattern; ...
to
...For the value af equal to (str.flags() & str.adjustfield),
if (af == str.internal) is true, the fill characters are placed
where none appears in the formatting pattern; the fill characters,
if any, are immediately followed by a single space where space
appears in the formatting pattern; ...
Martin