Victor Zverovich
14451704d5
Opt out std::complex from tuple formatting
2025-11-22 08:23:11 -08:00
Victor Zverovich
706fecea30
Apply clang-format
2025-11-22 06:45:50 -08:00
Victor Zverovich
fc17e825d9
Remove the broken fmt::say function
2025-11-12 11:06:01 -08:00
Victor Zverovich
1122268510
Make path formatting lossless with WTF-8
2025-11-05 10:59:06 -10:00
Victor Zverovich
a4c7e17133
Improve build speed, take 2
2025-11-04 10:19:39 -10:00
Victor Zverovich
bfd0129b91
Improve build speed
2025-11-04 09:33:18 -10:00
Victor Zverovich
ef7a566413
Reduce bloat-test result in debug mode from ~200k to ~85k
2025-11-03 16:21:10 -10:00
Victor Zverovich
5ac44cd128
Fix a warning
2025-11-03 13:39:29 -10:00
J. Berger
c3be070b7e
When using MSVC x86 to compile v12.0.0 or v12.1.0, conversions from __int64 to a 32bit unsigned int trigger warnings. ( #4594 )
...
This is a follow-up for PR #4572 .
2025-11-01 09:38:30 -07:00
Stéén
27bf8b47fe
Add FMT_CONSTEXPR to static_format_result members ( #4591 )
...
Co-authored-by: Robin Oger <roger@qcify.com>
2025-10-29 18:34:42 -07:00
Victor Zverovich
5987082c47
Bump version
2025-10-25 08:30:50 -07:00
Peter Hill
913507044b
Fix leaky diagnostic ignored pragma ( #4588 )
...
Ignoring the `-Wconversion` diagnostic in `make_format_args` was
leaking out of the header, resulting in that warning being ignored in
downstream code that includes `fmt/base.h`.
Instead, we should `push`/`pop` the diagnostics to ensure this is
cleaned up.
2025-10-25 08:28:24 -07:00
Victor Zverovich
ff357e9e4a
Remove extra whitespace
2025-10-25 08:10:57 -07:00
Victor Zverovich
728dfeab5b
Fix apidoc comment
2025-10-25 08:06:23 -07:00
Victor Zverovich
b95fd6132b
Avoid an ABI break for clang
2025-10-25 07:17:41 -07:00
Victor Zverovich
c0ddbacfd3
Bump version
2025-10-22 15:32:15 -07:00
Victor Zverovich
9395ef5fcb
Don't include std::locale::collate value in the symbol
2025-10-22 13:48:13 -07:00
Victor Zverovich
9721d974fc
Workaround ABI compatibility between clang and gcc
2025-10-22 12:34:47 -07:00
Fatih BAKIR
d6bdb69c62
Move FMT_API from ostream class to members ( #4584 )
...
Putting FMT_API on the class definition propagates it to the base class
detail::buffer<char>'s members. However, MSVC not emit definitions for
inline members unless it sees the symbols as FMT_API when compiling.
This fix removes the FMT_API declaration from the class itself and marks
individual non-inline members as FMT_API to address the issue.
Fixes https://github.com/fmtlib/fmt/issues/4576
2025-10-20 07:49:23 -07:00
Victor Zverovich
08d38d6e78
Make error_code formatter debug-enabled
2025-10-19 10:35:45 -07:00
Victor Zverovich
a2289b8593
Fix the build
2025-10-19 10:30:42 -07:00
Victor Zverovich
e2aa06cd0a
Workaround ABI incompatibility between clang ang gcc
2025-10-19 08:40:13 -07:00
Vladislav Shchapov
85f6ecc7a0
Add format_as support for std::variant and std::expected formatters ( #4575 )
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2025-10-18 14:05:21 -07:00
Harry Denholm
378a5ab3c1
value-initialise the buffer array member of detail::ansi_color_escape so that it can be used in a constexpr context in MSVC; compiler rejects as non-constant due to 'uninitialized symbol' otherwise ( #4581 )
...
Co-authored-by: Harry Denholm <ishani@users.noreply.github.com>
2025-10-17 08:10:56 -07:00
Justin Riddell
31bed1bb65
Fix module fmt::join<string_view> ( #4577 )
...
FMT_USE_STRING_VIEW define was incorrectly not being defined when using
modules, so there was no appropriate formatter specialization for
std::string_view
Fixes #4379
2025-10-16 11:25:19 -07:00
LiangHu
8eebb4334b
[fix] #4565 When using MSVC to compile v12.0.0, many compilation warn… ( #4572 )
2025-10-12 10:56:13 -07:00
Victor Zverovich
1234bc312e
Apply clang-tidy
2025-10-11 07:58:17 -07:00
rohitsutreja
b77a751625
Revert std::malloc/std::free to global malloc/free ( #4569 ) ( #4570 )
2025-10-10 09:37:05 -07:00
rohitsutreja
8db24c0ea9
restore 'inline' for normalize_libcxx_inline_namespaces ( #4571 )
2025-10-10 07:49:53 -07:00
Fatih BAKIR
03c7e28965
write_demangled_name supports libc++ + clang-cl ( #4560 )
...
The current implementation assumes whenever we're on an FMT_MSC_VERSION
compiler, the standard library is MSVC's STL. However, with clang-cl we
have the possibility of using LLVM libc++ instead of MSVC STL. In that
scenario, the previous implementation produced the wrong demangled names
for RTTI types.
This patch detects the different combinations, and combines the existing
demangling implementations to produce the correct names and make all
tests pass on libc++ + clang-cl.
2025-10-08 12:23:57 -07:00
Victor Zverovich
47a18b2fe9
Minor cleanup
2025-10-07 13:52:59 -07:00
Martin Valgur
b580360ab7
base.h: _BitInt is not available when Clang is used as a host compiler for NVCC ( #4564 )
2025-10-06 08:45:12 -07:00
Oleksandr Koval
486e7ba579
support std::optional holding cv-qualified types ( #4562 )
...
Fixes #4561
2025-10-03 04:40:44 -07:00
Victor Zverovich
27ea09836a
Error on unsafe uses of join
2025-10-02 16:24:22 -04:00
Victor Zverovich
b5b9317a3c
Warn about unsafe use of join
2025-10-02 12:35:07 -04:00
teruyamato0731
b9ac8b225d
style: Correct indentation in locale initialization ( #4557 )
2025-10-02 04:10:31 -07:00
Victor Zverovich
5f66e07cb0
Suppress an unused argument warning
2025-09-28 19:45:41 -04:00
Victor Zverovich
17be91c079
Fix a clang-tidy error
2025-09-26 08:28:51 -07:00
Victor Zverovich
dcea616535
Fix compilation with locale disabled in header-only mode
2025-09-26 07:48:43 -07:00
SnapperTT
a2fd48e039
Make FMT_USE_CONSTEVAL optional #4545 ( #4546 )
2025-09-24 11:00:41 -07:00
Nikita Tsarev
e28c371c0f
Fix ambiguous call to fprintf when compiling as a C++20 module ( #4548 )
2025-09-22 11:58:59 -07:00
Victor Zverovich
6b6cdd9405
Store size in a local variable while unchanged
2025-09-21 12:51:06 -07:00
Yuwei Zhao
4cce5f458d
Perf: Optimize function append in include/fmt/base.h ( #4541 )
2025-09-21 12:40:26 -07:00
CrackedMatter
b18ece7d71
Export is_compiled_string and operator""_cf ( #4544 )
2025-09-19 08:54:54 -07:00
Victor Zverovich
ddd20d57ec
Bump version
2025-09-17 09:14:47 -07:00
Victor Zverovich
a3b3d7ed46
Simplify duration cast
2025-09-13 11:32:03 -07:00
Victor Zverovich
83189189a1
Remove get_dynamic_spec
2025-09-13 10:38:50 -07:00
Victor Zverovich
9bb14ffc47
Remove deprecated APIs
2025-09-13 10:07:16 -07:00
Victor Zverovich
556c4177b6
Remove deprecated localtime
2025-09-13 09:41:24 -07:00
Victor Zverovich
bfdef8b15d
Remove deprecated functions
2025-09-13 09:25:53 -07:00
Victor Zverovich
609188cb92
Cleanup macro definitions
2025-09-07 07:44:49 -07:00
Anas
0a94e06750
Combined emphases into a single escape sequence ( #4528 )
2025-09-05 09:50:56 -07:00
Victor Zverovich
619b3a5aa0
Suppress a false positive in clang-tidy
2025-09-01 11:42:00 -07:00
Victor Zverovich
79c7f8a70b
Apply clang-tidy
2025-09-01 10:49:49 -07:00
Victor Zverovich
20e0d6d8dd
Update docs
2025-09-01 10:15:54 -07:00
Victor Zverovich
02fb76d69b
Add FMT_STATIC_FORMAT
2025-09-01 09:15:32 -07:00
Victor Zverovich
a57f196cad
Apply coding conventions
2025-09-01 07:24:08 -07:00
Victor Zverovich
13d4f8469e
Remove deprecated vformat_to
2025-08-31 10:02:36 -07:00
Victor Zverovich
e2f89e6d21
Remove deprecated aliases
2025-08-31 09:40:11 -07:00
Victor Zverovich
489fd7ca4b
Simplify locale handling
2025-08-31 09:33:43 -07:00
Victor Zverovich
69324379f2
Mark detail::assert_fail as deprecated
2025-08-31 08:11:57 -07:00
Björn Schäpers
ff1caa58c9
Use FMT_THROW in report_error ( #4521 )
...
With exceptions: No change (if FMT_THROW is not user provided)
Without exceptions: Now also states where it comes from (report_error)
and uses fprintf instead of fputs.
My motivation is, now that I have my own fmt::assert_failed, also to get
rid of fputs for my embedded build.
2025-08-31 08:05:54 -07:00
Björn Schäpers
e181e94140
Add FMT_CUSTOM_ASSERT_FAIL ( #4505 )
...
That way one can provide ones own implementation for assert_fail, which
is moved out of the detail namespace. For binary compatibility the
detail version stays to call the outer version.
2025-08-25 09:02:00 -07:00
Victor Zverovich
8e4676e4a5
Remove deprecated template parameter
2025-08-24 09:52:17 -07:00
Victor Zverovich
b5c4d25cd1
Rename is_char to is_code_unit
2025-08-24 09:30:50 -07:00
Victor Zverovich
a77efa4b4a
Move is_*char to detail
2025-08-24 09:16:18 -07:00
Victor Zverovich
e7e71009c7
Make FP formatting compatible with exotic chars
2025-08-24 08:49:54 -07:00
Victor Zverovich
b7b261977e
Simplify report_error
2025-08-24 08:30:17 -07:00
Victor Zverovich
61e0503daf
Merge workarounds for bogus MSVC warnings
2025-08-24 08:18:47 -07:00
Victor Zverovich
72c82296d6
Put FMT_END_* together
2025-08-17 12:25:40 -07:00
Victor Zverovich
a402614e8c
Remove deprecated aliases
2025-08-17 11:52:00 -07:00
Victor Zverovich
e719c43cc6
Apply coding conventions
2025-08-17 10:59:16 -07:00
Victor Zverovich
8a8ff6177c
Remove deprecated and undocumented has_formatter
2025-08-17 10:52:45 -07:00
Victor Zverovich
5b99b334f0
Remove redundant else
2025-08-17 10:03:01 -07:00
Mattias Ljungström
9588458917
Silence unreachable code warnings in MSVC when FMT_USE_EXCEPTIONS are disabled. ( #4515 )
2025-08-17 09:35:28 -07:00
Victor Zverovich
7ffc3ca15b
Minor cleanup
2025-08-16 12:20:02 -07:00
Victor Zverovich
e9ddc97b9a
Remove unnecesary constexpr and inline more
2025-08-10 08:40:35 -07:00
Murat Toprak
0d145936ec
Handle allocator propagation in basic_memory_buffer::move, Fix #4487 ( #4490 )
...
* Handle allocator propagation in basic_memory_buffer::move
Update `basic_memory_buffer::move` to respect `propagate_on_container_move_assignment`allocator trait.
If the allocator should not propagate and differs from the target's allocator,
fallback to copying the buffer instead of transferring ownership.
This avoids potential allocator mismatch issues and ensures exception safety.
* Add test cases for the updated move ctor
- Added two test cases `move_ctor_inline_buffer_non_propagating` and `move_ctor_dynamic_buffer_non_propagating`
- Added `PropageteOnMove` template parameter to `allocator_ref` class to be compatible with the old test cases
- `allocator_ref` now implements `!=` and `==` operators
2025-08-09 08:14:15 -07:00
Victor Chernyakin
8f3a965186
Refactor ansi_color_escape to track size instead of using a null terminator ( #4511 )
2025-08-09 08:08:41 -07:00
Victor Zverovich
add164f6b3
Optimize the default FP formatting
2025-08-03 12:46:38 -07:00
Victor Zverovich
23059d558e
Fix exponent size computation
2025-08-03 10:00:24 -07:00
Victor Zverovich
505cc3d0c2
Simplify remove_trailing_zeros
2025-08-03 08:45:48 -07:00
Victor Zverovich
b8a502615d
Revert "Optimize the default FP formatting"
...
This reverts commit 93f03953af6b0268e1a29bb5b23d50f72b87a151.
2025-08-03 07:40:13 -07:00
Victor Zverovich
93f03953af
Optimize the default FP formatting
2025-07-27 08:56:07 -07:00
Dominic Pöschko
35dcc58263
fix buffer overflow on all emphasis flags set ( #4498 )
2025-07-20 10:43:33 -07:00
Catherine
553ec11ec0
Make compatible with WASI ( #4497 )
...
WASI is a POSIX subset that doesn't have `dup`, `dup2`, or `pipe` system calls.
Fixes #4496 .
2025-07-14 15:51:04 -07:00
Victor Zverovich
7d29ebe4af
Minor cleanup
2025-07-12 07:09:38 -07:00
anonymous
20c8fdad06
Fix import std in clang++ ( #4488 )
...
fix module-compilation error when defined `FMT_IMPORT_STD`
2025-07-07 11:47:48 -07:00
Victor Zverovich
300ce75ca6
Handle invalid glibc FILE buffer
2025-07-06 11:17:16 -07:00
Victor Chernyakin
2fa3e1a1bb
Fix interaction between debug presentation, precision, and width for strings ( #4478 )
2025-07-04 07:33:47 -07:00
Miuna
27c5aab349
Fix unwanted char promotion in decimal writer with wchar_t ( #4483 )
2025-07-01 07:03:57 -07:00
Miuna
353bd895a2
Add FMT_EXPORT on ranges.h customization points ( #4476 )
2025-06-24 10:30:44 -07:00
Tomek-Stolarczyk
953cffa701
Replace memset with constexpr fill_n in bigint::align ( #4471 )
...
Use fill_n in place of memset in bigint::align to respect constexpr.
2025-06-23 16:18:16 -07:00
Vladislav Shchapov
571c02d475
Add xchar support for std::byte formatter ( #4480 )
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2025-06-23 14:02:11 -07:00
Remy Jette
f4345467fc
Fix compilation on clang-21 / libc++-21 ( #4477 )
...
`<cstdlib>` was not being included, so malloc and free were only declared
via transitive includes. Some includes changed in the latest libc++-21
build which broke fmt.
Also changed `malloc`/`free` to `std::malloc` and `std::free`, as
putting those symbols in the global namespace is optional for the
implementation when including `<cstdlib>`.
2025-06-21 07:28:14 -07:00
Victor Chernyakin
1ef8348070
Properly constrain detail::copy optimization ( #4474 )
2025-06-21 06:59:35 -07:00
Victor Chernyakin
067bc479b4
Avoid redundant work when processing UTF-8 strings ( #4475 )
2025-06-20 06:39:06 -07:00
Mikhail Svetkin
5860688d7e
Enable constexpr support for fmt::format (fmtlib#3403) ( #4456 )
2025-06-07 07:16:49 -07:00
Victor Zverovich
46be88bc1e
Cleanup FP formatting
2025-06-01 09:15:20 -07:00
Thomas Khyn
cc88914904
Export fmt::dynamic_format_arg_store in fmt module ( #4459 )
2025-06-01 08:50:14 -07:00