Граф коммитов

100 Коммитов

Автор SHA1 Сообщение Дата
A. Jiang 30c9391b91
`requires` for `chrono::parse` and comparison category detection (#5044)
Co-authored-by: Casey Carter <cartec69@gmail.com>
2024-10-30 07:50:12 -07:00
Stephan T. Lavavej 720537800e
Toolset update: VS 2022 17.12 Preview 3, Python 3.13.0 (#5017)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
2024-10-16 22:43:45 -07:00
Stephan T. Lavavej 6cb175ddf8
Toolset update: VS 2022 17.12 Preview 2, Clang 18.1.8 (#4947) 2024-09-11 20:13:13 -07:00
blackninja9939 a36ece0b71
Implement P3107R5 optimized `<print>` (#4821)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2024-09-03 21:40:31 -07:00
A. Jiang 1acbeae8df
`<chrono>`: Add comments for compiler bug workarounds (#4920)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2024-08-27 21:32:53 -07:00
A. Jiang c2ab0400bb
Speculatively implement LWG-4139 [time.zone.leap] recursive constraint in `<=>` (#4902) 2024-08-25 11:35:11 -07:00
Stephan T. Lavavej fd797a9746
Fix warning C26818 about `switch` statements needing `default` cases (#4715) 2024-06-17 22:34:01 -07:00
A. Jiang 23344e2643
Use `requires`-clauses and concepts for miscellaneous C++20/23 components (#4637) 2024-05-20 15:50:10 -07:00
Alex Guteniev 697653d506
Refactor `<limits>` usage (#4634)
Co-authored-by: A. Jiang <de34@live.cn>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2024-05-20 15:42:40 -07:00
Stephan T. Lavavej 0c245adce1
Use `_STL_INTERNAL_STATIC_ASSERT(false)` when appropriate (#4624) 2024-04-26 16:49:00 -07:00
Stephan T. Lavavej 1955118800
Change `_Always_false` to `false` for functions (#4591)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
2024-04-18 18:15:08 -07:00
mq白 213df0c390
Optimized string concatenation in `_Tzdb_update_version()` (#4577)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2024-04-12 11:36:47 -07:00
A. Jiang daeb0a63b1
Drop `inline`/`_INLINE_VAR` from templated `constexpr` variables in product and test codes (#4546)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2024-04-09 14:05:30 -07:00
Stephan T. Lavavej 64e410c8d9
Toolset update: VS 2022 17.10 Preview 1 (#4392) 2024-02-16 12:32:41 -08:00
Stephan T. Lavavej f49ffd2e58
Cleanup compiler bug workarounds and their comments (#4362) 2024-02-06 02:52:46 -08:00
S. B. Tam 0c47a7cfc9
Enable `__cpp_lib_concepts` for EDG, part 3 (#4298)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2024-02-06 01:05:52 -08:00
Muhammad Al-Tahan 629216acf0
`<chrono>`: Fix `formatter` ignoring dynamically provided width (#4283)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2024-01-11 15:07:12 -08:00
S. B. Tam 4e9a5cbf65
<chrono>: Make format() accept %X and %EX for duration and hh_mm_ss (#4250) 2023-12-14 14:06:49 -08:00
Stephan T. Lavavej 3ef9108d3f
`<chrono>`: Make `tzdb_list`'s internal ctor harder to unintentionally use (#4229) 2023-12-07 08:40:00 -08:00
A. Jiang 8234695bd7
Implement `formatter<vector<bool>::reference>` (#4133)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-authored-by: Jakub Mazurkiewicz <mazkuba3@gmail.com>
2023-11-29 12:29:21 -08:00
S. B. Tam 4b1de7b4f0
`<format>`: Reject dynamic width or precision of non-integral type (#4155) 2023-11-16 19:20:41 -08:00
Stephan T. Lavavej f392449fb7
Various cleanups: `<chrono>` (#4119) 2023-10-25 18:50:46 -07:00
A. Jiang b34b4ad716
Implement `formattable`, `range_format`, and `format_kind` (#4116)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2023-10-25 18:47:42 -07:00
achabense d16d735cb6
Cleanups for `<exception>` (#3973) 2023-09-07 14:09:05 -07:00
Alex Guteniev 9ad382e2f5
Update preprocessor `#else` comment in product code to clarify which mode is where (#3900)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2023-08-10 16:48:21 -07:00
Stephan T. Lavavej 92d050e02b
Drop `#pragma once` in STL headers (#3895) 2023-07-26 11:54:17 -07:00
Stephan T. Lavavej f70d767e3b
Remove unnecessary `typename`s in all remaining headers (#3894)
Co-authored-by: Casey Carter <cacarter@microsoft.com>
2023-07-26 11:51:57 -07:00
Casey Carter e8562273f7
Remove some unnecessary clang-format hacks (#3768) 2023-06-15 02:14:47 -07:00
Stefan 99d36f56a2
Fix `hh_mm_ss` formatting for values >= 1 day (#3727)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2023-06-15 01:33:18 -07:00
A. Jiang a4bb668f72
Move some components from upstream headers to downstream (#3719)
Co-authored-by: Casey Carter <cartec69@gmail.com>
2023-05-30 15:58:38 -07:00
Stephan T. Lavavej a62109595b
Toolset update: VS 2022 17.7 Preview 1 (#3711)
* PowerShell 7.3.4.

* New pool.

* VS 2022 17.7 Preview 1.

* Require Clang 16.

* Remove workaround for VSO-1753916 'C++23 tuple causes x86chk assertion: !"If lookup found RDSymbol before it should find something this time, too", ParseTree.cpp 10376'.

* Remove workarounds for VSO-1799670 "EDG rejects constexpr vector in debug mode with 'attempt to access expired storage' errors, part 3".

* Remove workarounds for LLVM-44833 "[concepts] deferred substitution into requirements of class template members not implemented".

* [llvm16] Clang has implemented P0960; unskip tests that now pass, and remove workaround in `P2474R2_views_repeat`.

* [llvm16] Clang now warns about overriding `/fp:strict` with `-ffp-contract`. Update `floating_point_model_matrix.lst` to silence these warnings.

* [llvm16] Fix redeclaration of `adjacent_transform_view` (atomic constraint expressions effectively cannot be reproduced since each utterance is distinct).

* [llvm16] Disambiguate `tuple` comparison operators.

* [llvm16] Workaround LLVM-62290, which has been fixed for Clang 17, in `<ranges>`.

* [llvm16] Remove workarounds for a couple of `TRANSITION, Clang 16` issues in `<ranges>` and `<type_traits>`.

* [llvm16] Perma-workaround unfiled clang bug in `P0896R4_views_take`.

* [llvm16 followup] Improve arrow comments.

* [llvm16 followup] We `_EXPORT_STD` both declarations and definitions.

* Disable UBSan to work around GH 3568 "Investigate why Clang/LLVM UBSan doesn't link".

* Guard `_addcarry_u64`/`_subborrow_u64` for Clang.

* `LDBL_DECIMAL_DIG` is now missing for Clang too.

* Although LLVM-46207 is still open, Clang now likes tgmath.h.

* Cite LLVM-62096 "Clang complains about concept depending on itself".

* Add workaround for LLVM-62762 "32-bit-only misoptimization of printf calls on Windows".

* clang-format 16, no manual changes.

The changes are almost entirely positive, with no horrible mangling,
and limited weirdness around `&`, `&&`, and `*`. No need for manual fixups.

* .clang-format: Update link to Clang 16.

* .clang-format: Sort defaults, no behavioral changes.

* .clang-format: Drop commented-out defaults, no behavioral changes.

`BreakBeforeInheritanceComma` and `BreakConstructorInitializersBeforeComma`
were never documented and aren't printed out by `-dump-config` anymore.

The weird empty `BasedOnStyle` isn't printed out by `-dump-config` anymore.

`ConstructorInitializerAllOnOneLineOrOnePerLine` and `AllowAllConstructorInitializersOnNextLine`
are now deprecated and aren't printed out by `-dump-config` anymore.

* .clang-format: `DeriveLineEnding` and `UseCRLF` were deprecated and fused into `LineEnding`, no behavioral changes.

* .clang-format: `AlignTrailingComments` is no longer a bool. Use the new options, no behavioral changes.

* .clang-format: `SortUsingDeclarations` (which we didn't customize) is no longer a bool, no behavioral changes.

* .clang-format: Add new defaults, no behavioral changes.

* .clang-format: `InsertNewlineAtEOF` is new, set it to `true`. Doesn't change any files right now.

* .clang-format: `RemoveSemicolon` is new, set it to `true`.

* clang-format 16, no manual changes - remove semicolons.

---------

Co-authored-by: Casey Carter <Casey@Carter.net>
2023-05-18 14:14:16 -07:00
A. Jiang d3a7da7ace
Cite N4950 in headers and source files (#3686)
Towards #182.

- This PR drops all section numbers except for D.x in `<yvals_core.h>`. I decided to cite WG21-N4868 for C++20 deprecation.
- Some citations in `<format>` are intentionally not updated because WG21-P2675R1 and LWG-3631 are not implemented yet.
- Citations in test files are not updated, but I think I'll do it soon.
- Drive-by change: a comment for `move_only_function`'s move assignment operator explaining why it's `noexcept(false)` (see https://github.com/microsoft/STL/pull/3565#discussion_r1134755402 and https://github.com/microsoft/STL/issues/2278#issuecomment-943360927).

---------

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Nicole Mazzuca <mazzucan@outlook.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
2023-05-18 11:38:57 -07:00
S. B. Tam 9fdc896368
Implement the `?` format specifier for strings and characters (#3656)
This implements [\[format.string.escaped\]], which is part of WG21-P2286R8 "Formatting Ranges" and modified by WG21-P2713R1 "Escaping Improvements In `std::format`". Works towards #2919.

To implement this feature, two arrays, `__printable_ranges` and `_Grapheme_Extend_ranges`, are added to `__msvc_format_ucd_tables.hpp`.

- `__printable_ranges` represents code points whose [`General_Category`] is in the groups `L`, `M`, `N`, `P`, `S` (that is, code points that are *not* from categories `Z` or `C`), plus the ASCII space character.
  - Characters outside of these ranges are always escaped, usually using the `\u{hex-digit-sequence}` format. ([\[format.string.escaped\]/(2.2.1.2.1)])
  - It might make sense to store the unmodified `General_Category`, instead of this invented property. This requires more storage and a new data structure, though.
- `_Grapheme_Extend_ranges` represents code points with the Unicode property `Grapheme_Extend=Yes`.
  - Characters in these ranges are escaped unless they immediately follow an unescaped character. ([\[format.string.escaped\]/(2.2.1.2.2)])
  - It would be more space efficient to reuse the existing data for `Grapheme_Cluster_Break`: `Grapheme_Extend=Yes` is `Grapheme_Cluster_Break=Extend` minus `Emoji_Modifier=Yes`, and `Emoji_Modifier=Yes` is just `1F3FB..1F3FF`. I chose to define a new array for simplicity.

When the literal encoding is not UTF-8, UTF-16, or UTF-32, the set of "separator or non-printable characters" is implementation-defined. In this implementation, the set consists of all characters that correspond to non-printable Unicode code points (that is, code points outside of `__printable_ranges`, see above). If a character is non-printable, it is translated into `\u{XXXX}`, where `XXXX` is the hex value of the Unicode code point (not the original value).

If a code unit sequence cannot be converted to a Unicode scalar value, the `\x{XX}` escape sequence is used.

[`General_Category`]: https://www.unicode.org/reports/tr44/#GC_Values_Table
[\[format.string.escaped\]]: http://eel.is/c++draft/format.string.escaped
[\[format.string.escaped\]/(2.2.1.2.1)]: http://eel.is/c++draft/format.string.escaped#2.2.1.2.1
[\[format.string.escaped\]/(2.2.1.2.2)]: http://eel.is/c++draft/format.string.escaped#2.2.1.2.2
2023-05-18 09:34:01 -07:00
A. Jiang bb1798f238
`<chrono>`: Fix formatting for unusual `duration`s (#3649)
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2023-04-28 12:29:38 -07:00
YairBorn 3c1f3d79ea
Fix `ambiguous_local_time`'s message is slightly incorrect (#3650) 2023-04-13 20:41:34 -07:00
Stephan T. Lavavej a9ecd92ac9
Toolset update: VS 2022 17.6 Preview 3 (#3651) 2023-04-13 19:43:50 -07:00
A. Jiang 7eeef474bc
Don't include `<algorithm>` in `<chrono>` (#3626) 2023-04-07 13:56:37 -07:00
A. Jiang c0113f394f
Prefer `consteval` to `_CONSTEVAL`, enable `<source_location>` for Clang (#3584) 2023-03-28 12:05:29 -07:00
S. B. Tam d27f041725
`<chrono>`: Optimize `to_sys` and `to_local` (#3579)
Co-authored-by: Nicole Mazzuca <mazzucan@outlook.com>
2023-03-28 11:57:29 -07:00
Tyler Nichols 8a6ec5a5fc
P2093R14: Formatted Output (#3337)
Co-authored-by: S. B. Tam <cpplearner@outlook.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
2023-03-23 18:27:55 -07:00
Stephan T. Lavavej 326473d595
Cleanups: Formatting and comments (#3523)
Co-authored-by: Jakub Mazurkiewicz <mazkuba3@gmail.com>
2023-03-07 11:33:51 -08:00
A. Jiang 1763113bd8
Eliminate spaces in `operator"" name()` (#3453)
Co-authored-by: S. B. Tam <cpplearner@outlook.com>
2023-02-13 17:04:55 -08:00
Stephan T. Lavavej ea092540b4
Enable `/clr` C++20 support (#3194) 2022-11-07 18:45:18 -08:00
Stephan T. Lavavej 2f8342a3a5
Toolset update: VS 2022 17.4 Preview 3, Clang 15 (#3155)
Co-authored-by: Casey Carter <Casey@Carter.net>
2022-10-14 13:00:48 -07:00
Stephan T. Lavavej 2f03bdf361
P2465R3 Standard Library Modules `std` And `std.compat` (#3108) 2022-09-19 14:47:02 -07:00
Casey Carter 05e5e6838e
Cleanup product code uses of feature-test macros (#3053)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2022-08-26 17:33:09 -07:00
S. B. Tam ff29e7a6d0
Implement P2419R2 Clarify Handling Of Encodings In Localized Formatting Of `chrono` Types (#2977)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2022-08-22 14:13:08 -07:00
Stephan T. Lavavej 18451dc254
Toolset update: VS 2022 17.3 Preview 3, Clang 14 (#2861)
Co-authored-by: Casey Carter <Casey@Carter.net>
2022-07-14 15:03:09 -07:00
Charlie Barto 51c24c4024
Fix chrono printing for durations with extremely small periods (#2814)
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
2022-07-11 16:45:21 -07:00
Stephan T. Lavavej ee43e7097e
My Little Operator: Friendship Is Magic (#2797) 2022-06-19 18:01:39 -07:00