Victor Zverovich
56c72a671c
Reduce locale dependency
2022-09-02 10:22:11 -07:00
Zach Toogood
4191477b98
Add formatter for std::exception ( #3062 )
...
Co-authored-by: fekir <federico.kircheis@gmail.com>
Co-authored-by: Alexey Ochapov <alexez@alexez.com>
Co-authored-by: Vladislav Shchapov <vladislav@shchapov.ru>
Co-authored-by: fekir <federico.kircheis@gmail.com>
Co-authored-by: Alexey Ochapov <alexez@alexez.com>
Co-authored-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-09-02 08:33:37 -07:00
Victor Zverovich
64e29893cf
Improve locale support
2022-09-01 14:48:43 -07:00
Vladislav Shchapov
33b4c33c5b
Requires FMT_CONSTEXPR20 support
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-29 13:33:48 -07:00
Vladislav Shchapov
a07411c2b9
Disable compile-time checks for dynamic width/precision test for LCC and compiler without std::is_constant_evaluated()
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-29 13:33:48 -07:00
Vladislav Shchapov
f98048b621
Fix bugs in utf8 decoder ( #3056 )
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-26 15:37:15 -07:00
Victor Zverovich
4a8e2949bb
Fix formatting of ranges of code unit types
...
Thanks Nicole Mazzuca.
2022-08-26 13:48:58 -07:00
Vladislav Shchapov
3a3b0709e2
Disable bogus -Wstringop-overflow on GCC 11 ( #3054 )
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-24 12:37:34 -07:00
Victor Zverovich
e724bbea16
Fix wchar_t corner cases
2022-08-24 12:23:10 -07:00
Victor Zverovich
dc59d3df3f
Fix a warning in gtest
2022-08-24 07:18:14 -07:00
Vladislav Shchapov
489dabbd31
Fix decoder on broken utf8 sequences. ( #3044 )
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-24 07:13:27 -07:00
Victor Zverovich
541cd21838
Fix locale name (thanks Mikhail Paulyshka)
2022-08-20 08:06:20 -07:00
Victor Zverovich
1f95c34381
Fix sign handling with large code units
2022-08-20 07:46:58 -07:00
Victor Zverovich
779449fd99
Belarusify test
2022-08-20 07:37:15 -07:00
Dimitrij Mijoski
fc23cfbf4e
Fix testsuite on MinGW + MSVCRT
...
Fixes #2952 . The testsuite indirectly called strftime() with conversion
specifiers defined only in C99. In MSVCRT this function conforms only to
C89. Only in the updated UCRT this functon provides the functionality of
C99.
2022-08-14 08:40:38 -07:00
Mark Santaniello
fd93b633b8
Constexpr formatted_size ( #3026 )
...
* Constexpr formatted_size
* Add C++20 tests for gcc 9 and 10
* Adjust unit test to require __cpp_lib_bit_cast
2022-08-10 09:35:30 -07:00
Victor Zverovich
7fb8d33f9d
Fix compile-time width/precision type check
2022-08-09 16:10:02 -07:00
Victor Zverovich
5f774c0aed
I shouldn't be there
2022-08-02 16:35:50 -07:00
Barry Revzin
0b2862a1e4
Range formatter ( #2983 )
...
* Implement range_formatter and format_kind
* Attempted gcc 4.8 fix
* gcc 4.8 interprets inaccessible as a hard error (instead of... not available)
* Attempting to delete set_debug_format.
* clang-format
* Different implementation of FMT_STATICALLY_WIDEN
* Renaming copy_str_range to copy_str.
* I guess I need a definition
* Forgot to delete these.
* Other PR comments.
2022-07-29 13:55:16 -07:00
Dimitrij Mijoski
bbcb129e02
Reduce filesize of the tests on MinGW ( #2995 )
...
This patch removes the workaround applied here
1acfd07f1e
.
MinGW is not tested on Appveyor anymore.
2022-07-22 20:11:33 -07:00
Victor Zverovich
48e0a59222
Implement compile-time checks for dynamic width/precision type
2022-07-22 17:00:40 -07:00
Victor Zverovich
00adc7120d
Add a regression test for here be dragons
2022-07-22 11:08:00 -07:00
Barry Revzin
92d36e82c4
The n specifier for ranges ( #2981 )
...
* The n specifier for ranges.
* Flipping flag polarity.
2022-07-12 10:08:38 -07:00
Victor Zverovich
05be7a0764
Use FMT_USE_FLOAT128 instead of __SIZEOF_FLOAT128__
2022-07-10 08:54:34 -07:00
Victor Zverovich
2a1b3ac629
Fix large shift in uint128_fallback
2022-07-10 08:27:21 -07:00
Daniel Krügler
e1d3d3a326
Exclude recursive ranges from the formatter specialization for ranges ( #2974 )
...
* 2954: Add test case
* Eliminate extra-test and merge it into existing std-test instead. Add conditionals for filesystem::path testing that does not run into the ambiguity problem.
* #2968 : Introduce additional compile-time predicate to detect recursive ranges and reject them in formatter specialization for ranges. In addition, introduce additional wrapper traits for the individual logical operands of the complete range constraints
* #2968 : Eliminate preprocessor condition that enables the formatter specialization for std::filesystem::path
* #2968 : Eliminate preprocessor condition that enables the test for the formatter specialization for std::filesystem::path
* Use own bool_constant, which is available for all C++ versions
* Reintroduce previous workaround but restrict to VS 2015 for now
* Comma fix
* - Rename is_not_recursive_range to is_nonrecursive_range and add comment that explains it being depending on is_range being true
- Merge has_fallback_formatter_delayed into is_formattable_delayed and add comment that explains it being depending on is_not_recursive_range being true
- Replace disjunction in formatter specialization by has_fallback_formatter_delayed
- Get rid of unneeded detail:: prefixes within namespace detail
2022-07-10 06:26:23 -07:00
Vladislav Shchapov
b31d1a75a0
Add xchar support for fmt::streamed().
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-07-05 19:07:06 -07:00
Vladislav Shchapov
831132293b
Workaround for Microsoft Visual Studio 2022 Internal compiler error.
...
D:\a\fmt\fmt\test\compile-test.cc(362,3): fatal error C1001: Internal compiler error. [D:\a\fmt\build\test\compile-test.vcxproj]
(compiler file 'D:\a\_work\1\s\src\vctools\Compiler\CxxFE\sl\p1\c\constexpr\constexpr.cpp', line 8635)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-07-04 07:18:21 -07:00
Vladislav Shchapov
115e00e0b9
Replace __cplusplus with FMT_CPLUSPLUS.
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-07-04 07:18:21 -07:00
Daniel Krügler
d2a2320820
Fix partial specialization problem for filesystem for Visual Studio ( #2957 )
...
* #2954 : Provide std::conjunction and std::disjunction substitutes
* #2954 : Use conjunction and disjunction substitute to make formatter specializations for ranges and maps more robust (especially for Visual Studio compiler family)
* #2954 : As workaround for older MSVC compilers split formatter<std::filesystem::path> partial template specialization into two explicit specialization.
* 2954: Add test case
* Provide simplified implementations of conjunction and disjunction
* Remove workaround explicit specializations if the partial specialization would cause an ambiguity error
* Eliminate extra-test and merge it into existing std-test instead. Add conditionals for filesystem::path testing that does not run into the ambiguity problem.
2022-07-03 11:06:54 -07:00
Victor Zverovich
0c06c81da8
Deprecated implicit conversion of enums to ints for consistency with scoped enums
2022-07-03 09:02:22 -07:00
Vladislav Shchapov
99bb5b1d17
Fix std::variant, std::filesystem::path tests on GCC-8, Clang-7,8.
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-07-02 08:34:52 -07:00
jehelset
6a775e9560
Add support for 'std::variant' in C++17 ( #2941 )
...
Add support for 'std::variant' in C++17.
For C++17, if all the alternatives of a variant are formattable
the variant is now also formattable. In addition 'std::monostate'
is now formattable.
Moves implementation into 'std.h', and tests into 'std-test.cc'.
Avoid fold-expression since MSVC was crashing.
Add section for 'fmt/std.h' in API-docs.
2022-06-26 07:28:01 -07:00
Victor Zverovich
9cb02aaaad
Fix UDLs
2022-06-25 08:52:10 -07:00
Victor Zverovich
2d931b1497
Add fmt::streamed
2022-06-24 09:26:24 -07:00
jehelset
5682338891
Fix is_formattable for tuple-like types. ( #2940 )
2022-06-19 08:25:58 -07:00
Vladislav Shchapov
f0de128449
Remove /source-charset:utf-8 compile option.
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-06-19 07:37:39 -07:00
Victor Zverovich
eaa8efb950
Fix ofstream handling in msvc
2022-06-16 15:02:33 -07:00
David Chisnall
2471875867
Make the tests pass on a CHERI system.
2022-06-10 07:02:03 -07:00
Victor Zverovich
b135f1c014
Refactor handling of argument types
2022-06-09 17:03:33 -07:00
Vladislav Shchapov
232e21d51f
Add utf-8 test for std::filesystem::path formatter.
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-06-04 10:10:21 -07:00
Victor Zverovich
9d60395953
Fix compilation on ppc64
2022-05-31 13:53:15 -07:00
Victor Zverovich
798d09bb70
Debug ppc failure
2022-05-30 13:06:34 -07:00
Victor Zverovich
926ddd0631
Move compile string to detail
2022-05-30 07:06:36 -07:00
Victor Zverovich
cb682f36f4
Move to_string_view to detail
2022-05-29 22:51:31 -07:00
Victor Zverovich
e927149f8e
Cleanup macros
2022-05-29 17:23:02 -07:00
Victor Zverovich
1761e2666a
Remove FMT_CONSTEXPR_DECL
2022-05-29 16:42:58 -07:00
Victor Zverovich
c83a5d42bb
FMT_MSC_VER -> FMT_MSC_VERSION
2022-05-29 15:39:08 -07:00
Victor Zverovich
7e63b600b6
Make to_string work with __float128
2022-05-29 12:23:57 -07:00
Vladislav Shchapov
65dd2ea52c
Use write_escaped_string to std::filesystem::path.
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-05-28 07:48:02 -07:00
Vladislav Shchapov
03b1b2838e
Improve std::filesystem::path formatter.
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-05-28 07:48:02 -07:00
Vladislav Shchapov
1f9eae7e31
Add xchar support for write_escaped_string.
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-05-27 08:36:38 -07:00
Victor Zverovich
ce246aaf74
Remove deprecated APIs
2022-05-22 07:10:09 -07:00
Victor Zverovich
440512f08d
Remove deprecated APIs
2022-05-21 12:20:31 -07:00
Victor Zverovich
c6324009ba
Add initial double-double support
2022-05-21 07:32:54 -07:00
Victor Zverovich
6bf039d750
Add std: 🧵 :id formatter
2022-05-17 16:37:19 -07:00
Victor Zverovich
9730fb0156
Fix path formatter
2022-05-17 14:29:49 -07:00
Victor Zverovich
f0903ad9df
Add a path formatter
2022-05-16 17:32:25 -07:00
Victor Zverovich
ae963e444f
Implement constexpr isfinite to avoid producing NaN
2022-05-11 08:43:22 -07:00
Victor Zverovich
358f5a7e50
Make precision computation consistent with width
2022-05-11 06:34:51 -07:00
Vladislav Shchapov
ffb5e6a732
Suppress a -Wliteral-range warning on Apple M1 ( #2861 )
2022-04-19 11:10:18 -07:00
Victor Zverovich
5d804ee7fe
Fix handling of subnormals in exotic FP
2022-04-17 08:56:35 -07:00
Victor Zverovich
192f79aaae
Fix handling of locale separators in FP formatting
2022-04-12 08:00:17 -07:00
Victor Zverovich
395cf0f03e
Fix detection of unformattable pointers
2022-04-12 06:45:46 -07:00
Mattias Ljungström
a935ac3e60
MSVC CMake generation optimization ( #2852 )
2022-04-08 06:27:23 -07:00
Victor Zverovich
22d31b31f0
Add a __float128 test
2022-04-03 14:56:29 -07:00
Victor Zverovich
f607e3e970
Add __float128 support
2022-04-03 12:58:06 -07:00
Victor Zverovich
686de58886
Implement 128-bit constant mul in bigint
2022-04-03 07:24:18 -07:00
Victor Zverovich
b4dc7a1d34
Add 128-bit operations to bigint
2022-04-02 09:29:13 -07:00
Victor Zverovich
96930161f9
Implement 128-bit operator+= for uint128_fallback
2022-03-27 08:07:54 -07:00
Victor Zverovich
db5b8993ac
Fix formatting of std::byte via format_as
2022-03-26 09:01:30 -07:00
Sean McBride
b591fc87dc
Fixed all clang -Wreserved-id-macro warnings (on macOS at least)
...
Avoid defining various reserved identifiers (starting with underscore and capital letter). Fortunately, they were all Windows-only, so it was easy to conditionalize them in Window-only preprocessor checks.
2022-03-24 07:33:43 -07:00
Victor Zverovich
4e39e13085
Remove xchar.h include from ostream.h
2022-03-18 10:53:15 -07:00
timsong-cpp
4ad90578f7
Fix #2818 : diagnose unformattable arguments in unpacked case
2022-03-18 10:11:14 -07:00
timsong-cpp
3d19be282a
Fix #2816 : strip named argument wrappers for compile-time checking
2022-03-18 10:11:14 -07:00
Victor Zverovich
ed18ca3eae
Implement isnan
2022-03-14 20:37:46 -07:00
Victor Zverovich
a204b8dde7
Add initial __float128 support
2022-03-14 19:34:41 -07:00
Victor Zverovich
b6b003b073
Cleanup test
2022-03-14 15:48:38 -07:00
Victor Zverovich
72f487562d
Simplify float_info
2022-03-14 13:37:03 -07:00
Victor Zverovich
f91f61cd13
Reuse num_significand_bits
2022-03-14 11:34:24 -07:00
Riccardo Brugo
a8fe8becf4
Fix compilation error for ranges with ADL begin
/end
( #2807 )
...
* Use `range_begin`/`end` to get formatted range iterators
* Add test for adl `begin`/`end`
* Apply clang-format
* Simplify tests
2022-03-11 11:36:39 -08:00
Riccardo Brugo
8c9bc070f5
Implement styled arguments ( #2793 )
...
* Implement styled arguments
* Inherit from formatter<Arg> to get the underlying `parse` and `format`
* Move styled_arg definition into the previous detail block
* Change styled_arg ctor parameters names to avoid shadowing members
* Move const before auto
* Remove redundant constructor for styled_arg
* Use the iterator instead of the buffer in styled_arg::format
* Remove unnecessary `styled` overloads
* Remove defaulted text_style parameter in styled function
2022-03-08 09:50:14 -08:00
Boris Dalstein
e3d688e79a
Fix warning C4251: class fmt::v8::file needs to have dll-interface ( #2797 )
...
* Fix warning C4251: class fmt::v8::file needs to have dll-interface
* Add CMake target dependency between test-main and fmt
2022-03-07 12:09:48 -08:00
Barry Revzin
0cef1f819e
Fixing formatting of certain kinds of ranges of ranges. ( #2787 )
...
* Fixing formatting of certain kinds of ranges of ranges.
* Renaming const_range to range_type.
2022-03-04 16:21:00 -08:00
Victor Zverovich
4fcacea354
Parameterized fp on significand type
2022-02-21 07:25:13 -08:00
Victor Zverovich
cbc59ca893
Clear moved from memory buffer
2022-02-20 08:12:59 -08:00
Vladislav Shchapov
ea3d326c63
Fix clang -Wliteral-range warning ( #2779 )
2022-02-19 10:52:33 -08:00
Victor Zverovich
aad44f2839
Add fmt::enums::format_as
2022-02-19 08:03:42 -08:00
Victor Zverovich
a0b43bfae2
Add support for 96-bit long double
2022-02-18 18:01:49 -08:00
Victor Zverovich
2c8cd2db34
Fix handling of zero precision
2022-02-18 12:38:30 -08:00
Victor Zverovich
47da218cc3
Remove uintptr_fallback
2022-02-18 07:03:33 -08:00
Victor Zverovich
4ddab8901c
Merge accumulator into int128_fallback
2022-02-18 06:17:28 -08:00
Victor Zverovich
d38f72aff2
Refactor fallback ints
2022-02-17 20:24:42 -08:00
Victor Zverovich
15c2a3bacc
int128_t -> int128_opt
2022-02-17 20:03:25 -08:00
Victor Zverovich
ce93a66dfb
Implement a fallback uint128_t
2022-02-17 07:37:09 -08:00
Victor Zverovich
6a13464059
Include 128-bit with other signed integers in specifier check
2022-02-16 16:57:06 -08:00
Vladislav Shchapov
10e3b83a75
Replace `make_args_checked
with
make_format_args
` ( #2760 )
...
* Replace make_args_checked to make_format_args
* Deprecate legacy make_args_checked
2022-02-13 20:13:35 -08:00
Victor Zverovich
afbcf1e8ea
Remove legacy C locale wrapper
2022-02-05 12:37:21 -08:00
Victor Zverovich
17b362f78c
Simplify ostream opt-in API
2022-02-04 18:33:59 -08:00
Victor Zverovich
f055ebbd25
Make ostream operators opt in to reduce the risk of ODR violations
2022-02-04 15:06:45 -08:00