Commit Graph
269 Commits
Author SHA1 Message Date
Victor Zverovich 0a917ee2f5 Minor comment tweak 2025-04-19 10:18:01 -07:00
hirohira b8192d233a Fix build error with MSVC v141 (#4413) 2025-04-15 08:21:38 -07:00
Victor Zverovich 3607e92dc9 Bump version 2025-03-23 10:44:46 -07:00
Victor Zverovich 9d6e24c64e Fix handling of long with FMT_BUILTIN_TYPES=0 2025-03-22 07:52:54 -07:00
Victor Zverovich 6fdf225a32 Always inline value ctors in optimized gcc mode only
This reverts commit 332da79bf3.
2025-03-16 10:03:53 -07:00
Victor Zverovich 332da79bf3 Always inline value ctors 2025-03-16 09:31:52 -07:00
Victor Zverovich 7b273fbb54 Minor cleanup 2025-03-16 08:58:44 -07:00
Dean Glazeski 37e6474718 Fix dynamic named arg format spec handling (#4361)
When dealing with dynamic named format args, need to account for
nested named args when skipping the content of the replacement.

Fixes #4360
2025-03-15 09:34:11 -07:00
Victor Zverovich 9212ff6ca1 Apply coding conventions and use constexpr 2025-03-02 09:03:06 -08:00
Dean Glazeski 864bdf9638 Report error on duplicate named arg names (#4367) 2025-03-02 07:47:03 -08:00
Victor Zverovich 4e5aafbf43 Bump version 2025-02-25 17:20:47 -08:00
Victor Zverovich 3401ce2be2 Fix ABI compatibility 2025-02-25 13:32:24 -08:00
Dean 7f7695524a Fix conflict with std::ignore (#4356)
In situations where `using namespace std;` is used, compiler warnings
can be generated because of local variables named `ignore`. This renames
those variables to something else to address the name conflict.
2025-02-19 23:08:21 -08:00
Victor Zverovich 0ca42e836e Workaround an MSVC v140 bug 2025-02-13 14:12:16 +01:00
Sergiu Deitsch d5b866e242 fix gcc 8.3 compile errors (#4336) 2025-02-03 08:51:58 -08:00
LocalSpook c9267da4df Fix typo in FMT_HAS_BUILTIN check 2025-01-31 08:42:19 -08:00
timsong-cpp f841ae61e2 Fix #4303: avoid instantiating formatter<const T> (#4325) 2025-01-24 10:53:10 -08:00
Victor Zverovich 41539c29f3 Workaround a bug in gcc 6 (#4318) 2025-01-22 11:12:41 -08:00
Victor Zverovich 9ff9c695db Bump version 2025-01-18 10:28:46 -08:00
Aaron Bishop 937b7c5c10 Add args() accessor back to fmt::format_context (#4310)
Add args() accessor back to fmt::format_context
Add test that would fail to compile if you can't create a fmt::format_context from another fmt::format_context
2025-01-17 10:28:34 -08:00
Victor Zverovich 01914f0389 Reduce size of basic_specs 2025-01-12 09:18:11 -08:00
Victor Zverovich c43da35701 Workaround an ICE when using modules with gcc 14.2 and earlier 2025-01-12 08:57:43 -08:00
Victor Zverovich b0b3dc5ff9 Bump version 2025-01-12 08:13:56 -08:00
Victor Zverovich 586ea06f02 Rename set_fill to copy_fill_from 2025-01-11 09:22:15 -08:00
Victor Zverovich 21aa0956d4 Restore ABI compatibility 2025-01-10 17:36:09 -08:00
Vladislav Shchapov 2c3a5698ef Simplify a copying the fill from basic_specs
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2025-01-05 09:33:05 -08:00
Victor Zverovich e9ec4fdc88 Bump version 2024-12-27 08:41:06 -08:00
Victor Zverovich feb72126b4 Readd FMT_NO_UNIQUE_ADDRESS 2024-12-26 13:54:06 -08:00
Victor Zverovich 3e04222d53 Restore ABI compatibility with 11.0.2 2024-12-26 10:45:15 -08:00
Victor Zverovich 11742a09c7 Clarify that format_string should be used instead of fstring 2024-12-26 09:39:01 -08:00
Victor Zverovich faf3f84085 Bump version 2024-12-25 08:18:51 -08:00
Victor Zverovich a3ef285aec Always inline const_check to improve debug codegen in clang 2024-12-24 12:54:44 -08:00
Vladislav Shchapov 542600013f Suppress MSVC warnings "C4127: conditional expression is constant" by used const_check (#4233)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2024-11-09 07:43:46 -08:00
Victor Zverovich cf50e4d6a4 Fix const[expr] in context API 2024-11-03 07:25:52 -08:00
Victor Zverovich 8523dba2dc Make constexpr precede explicit consistently 2024-11-02 11:03:03 -07:00
Victor Zverovich 1521bba701 Use consistent types for argument count 2024-11-02 08:08:36 -07:00
Sergey 68f3153762 Fix narrowing conversion warning in struct fstring (#4210)
Warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data.
2024-10-27 06:41:20 -07:00
Vladislav Shchapov 168df9a064 Implement fmt::format_to into std::vector<char> (#4211)
* Implement fmt::format_to into std::vector<char>

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>

* Move get_container to the trait

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>

---------

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2024-10-26 09:23:59 -07:00
Sergey 4daa3d591f Fix error: cannot use 'try' with exceptions disabled in Win LLVM Clang (#4208)
Fixes #4207.

LLVM Clang on Windows does not define `__GNUC__`. The preprocessor falls
to `#elif FMT_MSC_VERSION && !_HAS_EXCEPTIONS` with `_HAS_EXCEPTIONS 1`
defined in vcruntime.h:104.
2024-10-23 10:43:55 -07:00
Victor Zverovich 601be1cbe7 Add support for code units > 0xFFFF in fill 2024-10-19 08:15:50 -07:00
Vinay Yadav 58c185b634 Changing type of data_ to size_t to avoid compilation warnings (#4200)
Changing type data_ to size_t because
1. If lib is cross-compiled for win32 using MXE environment it cause
   compilation warning -Wconversion on line 730 as sizeof(unsigned long)
   = 4 and sizeof(size_t) = 8
2. When lib is compiled on Unix like compiler generate warning
   -Wuseless-cast if static_cast is used to fix issue in 1
2024-10-19 06:59:21 -07:00
Haowei 22701d5f63 Address build failures when using Tip-of-Tree clang. (#4187)
When using ToT clang to build fmtlib, it complains 'sv' is not
initialized by a constant expression. This patch addresses this
issue.
2024-10-04 06:45:29 -07:00
Casey Carter e62c41ffb0 Conform std::iterator_traits<fmt::appender> to [iterator.traits]/1 (#4185)
* Conform `std::iterator_traits<fmt::appender>` to [iterator.traits]/1

> In addition, the types
> ```c++
> iterator_traits<I>::pointer
> iterator_traits<I>::reference
> ```
> shall be defined as the iterator’s pointer and reference types; that is, for an iterator object `a` of class type, the same type as `decltype(a.operator->())` and `decltype(*a)`, respectively. The type `iterator_traits<I>::pointer` shall be void for an iterator of class type `I` that does not support `operator->`. Additionally, in the case of an output iterator, the types
> ```c++
> iterator_traits<I>::value_type
> iterator_traits<I>::difference_type
> iterator_traits<I>::reference
> ```
> may be defined as `void`.

* Remove unnecessary member types from basic_appender

This reverts commit 1accf6c0a043fb445cbbfeefdbc1f91a08e3099f.

* Address clang-format issue
2024-10-03 09:05:14 -07:00
Victor Zverovich 3faf6f181e Add min_of/max_of 2024-09-29 10:24:39 -07:00
Victor Zverovich d64b100a30 Relax constexpr 2024-09-29 10:04:57 -07:00
Victor Zverovich ff9ee0461a Fix handling FMT_BUILTIN_TYPES 2024-09-28 09:23:48 -07:00
Victor Zverovich cacc3108c5 Don't assume repeated evaluation of string literal produce the same pointer
Patch by @zygoloid (#4177).
2024-09-28 08:09:33 -07:00
Justin Riddell fade652ade Require clang >=15 for _BitInt support (#4176)
For appleclang, fixes issue #4173
2024-09-26 16:10:51 -07:00
Cameron Angus 96dca569a1 Module linkage fixes for shared build (#4169)
* Mark some in-class defined member functions as explicitly inline/constexpr, to avoid missing external symbols when using fmt module with shared build due to modules not defaulting to implicit inline.

* Switch constexpr to inline for context::arg(string_view).
NOTE: Looks as if basic_format_args::get(string_view) could probably be made constexpr instead, but sticking with minimal change approach.

* Work around apparent non-conformance of older MSVC compilers.

* Switch format_int::str() from constexpr to inline to satisfy libstdc++ std::string constexpr limitations.

* Replace usages of macros for constexpr/inline with keywords.

* Fix for locations requiring C++14 constexpr.

* Further minor constexpr tweaks.

* Apply clang format
2024-09-26 07:53:55 -07:00
Victor Zverovich ff92223549 Simplify locale handling 2024-09-22 10:21:19 -07:00