[libc++][format] Fix precision parser conformance.
authorMark de Wever <koraq@xs4all.nl>
Wed, 29 Dec 2021 18:50:38 +0000 (19:50 +0100)
committerMark de Wever <koraq@xs4all.nl>
Wed, 5 Jan 2022 16:41:36 +0000 (17:41 +0100)
commitf2b40ba40004bfb70d90e9787ad8c9ab6d85646b
treee1fc62537342980046fc7f840f2ec250a48101ee
parentc05db63887e8e3725134f67642ce1c648171bbd5
[libc++][format] Fix precision parser conformance.

@CaseyCarter reported that the tests for the std-format-spec rejects leading
zeroes for precision, which the Standard does not require. The Standard allows
them. Only for precision, not for the width or an arg-id.

Fixes the precision parser and adds some test for the arg-id since they
were missing.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D116381
libcxx/include/__format/parser_std_format_spec.h
libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string.pass.cpp
libcxx/test/std/utilities/format/format.functions/format_tests.h