Commit Graph

1651 Commits

Author SHA1 Message Date
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