Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for FMT_ENFORCE_COMPILE_STRING, fix several errors #2038

Merged
merged 34 commits into from
Dec 24, 2020
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e05c8fc
Add test
Nov 30, 2020
f76c64a
fix wide string formatting
Nov 30, 2020
b75bd49
fix formatted_size
Nov 30, 2020
2f9484c
fix chrono
Nov 30, 2020
3b6d21b
clang-format, test fixes
Nov 30, 2020
aa65e99
fix ranges
Nov 30, 2020
54d6d5b
fix gcc test
Nov 30, 2020
e805e8e
workaround MSVC bug
Nov 30, 2020
1fbfccc
Improve docs
Nov 30, 2020
55600c9
fix ranges.h
Nov 30, 2020
35b94fa
increase MSVC version restriction
Nov 30, 2020
1e034bd
try a fix for strange gcc failures
Dec 1, 2020
900adeb
fix gcc pedantic error
Dec 1, 2020
7f1c041
fix gcc errors
Dec 1, 2020
d343e4b
fix MSVC version check #if statements
Dec 1, 2020
c4c8351
trim down compiletime test
Dec 4, 2020
60bceae
fixup chrono.h with better notes about MSVC workaround
Dec 4, 2020
b61537a
restore missing include
Dec 4, 2020
d539f76
cleanup doc string
Dec 8, 2020
dafbc05
fixup test
Dec 8, 2020
9fafb14
fix unused arg issue in test
Dec 8, 2020
2489501
fix gcc issue
Dec 8, 2020
b8ebadd
fixup chrono MSVC workaround
Dec 9, 2020
098de0d
Remove formatted_size overlaod accepting compile-time strings
Dec 12, 2020
8e575bd
address comments
Dec 13, 2020
f2a5a0f
restore ifdef guarding GCC bug
Dec 13, 2020
c85d5e3
address easy comments
Dec 21, 2020
b9063f9
remove vformat from chrono.h
Dec 21, 2020
98a8830
attempt stripping void casts
Dec 21, 2020
b0c65df
Refactor ranges, fix chrono, apply clang format to include/fmt/*.h
Dec 21, 2020
6f393f2
fixup constexpr issues
Dec 21, 2020
06a576c
revert locale format fix
Dec 24, 2020
99ed2a8
address feedback
Dec 24, 2020
5083486
move array of literals format test
Dec 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve docs
  • Loading branch information
Walter Gray committed Dec 21, 2020
commit 1fbfcccb1bfdff66c9fb363cf14ccd5533198502
8 changes: 8 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ functions in their ``formatter`` specializations.

.. _udt:

Enforcing Compile-time Format Checks
------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this doesn't need to be a separate section. Instead add a paragraph to the Compile-time Format String Checks section above.

To force the use of Compile-time checks, compile with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compile -> compile

``FMT_ENFORCE_COMPILE_STRING`` defined. When this preprocessor definition is
given, functions accepting ``FMT_STRING`` will fail to compile with regular
strings. When this is set, runtime-checked formatting is still possible using
``fmt::vformat``, ``fmt::vprint``, etc.

Formatting User-defined Types
-----------------------------

Expand Down