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

Fixing "C4127: conditional expression is constant" Visual Studio 2022 warning in pedantic mode #2783

Merged
merged 1 commit into from
Feb 21, 2022

Conversation

chronoxor
Copy link
Contributor

No description provided.

@@ -2260,7 +2260,7 @@ FMT_CONSTEXPR20 auto write(OutputIt out, T value,
precision = 1;
}
if (const_check(std::is_same<T, float>())) fspecs.binary32 = true;
if (!std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::digits > 64)
if (const_check(!std::numeric_limits<T>::is_iec559) || std::numeric_limits<T>::digits > 64)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe:

if (const_check(!std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::digits > 64))

?

std::numeric_limits<T>::digits is constexpr too.

Copy link
Contributor

Choose a reason for hiding this comment

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

and please apply clang-format

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@vitaut vitaut merged commit 1a18a2f into fmtlib:master Feb 21, 2022
@vitaut
Copy link
Contributor

vitaut commented Feb 21, 2022

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants