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

silence warning C4100 on MSVC 2019 when exceptions are disabled #2397

Merged
merged 1 commit into from
Jul 2, 2021
Merged
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ struct monostate {
// `(void)var` method does not work on many intel compilers. This is
// from Herb Sutter, "Shutting up compiler warnings",
// https://herbsutter.com/2009/10/18/mailbag-shutting-up-compiler-warnings/
template <class T> void ignore_unused(const T&) {}
template <class... Ts> FMT_CONSTEXPR void ignore_unused(const Ts&...) {}

// An enable_if helper to be used in template parameters which results in much
// shorter symbols: https://godbolt.org/z/sWw4vP. Extra parentheses are needed
Expand Down Expand Up @@ -367,7 +367,8 @@ FMT_NORETURN FMT_API void assert_fail(const char* file, int line,
#ifndef FMT_ASSERT
# ifdef NDEBUG
// FMT_ASSERT is not empty to avoid -Werror=empty-body.
# define FMT_ASSERT(condition, message) ((void)0)
# define FMT_ASSERT(condition, message) \
::fmt::ignore_unused((condition), (message))
# else
# define FMT_ASSERT(condition, message) \
((condition) /* void() fails with -Winvalid-constexpr on clang 4.0.1 */ \
Expand Down