-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
<cmath>
, <limits>
: Locally disable -Wnan-infinity-disabled
for Clang
#4990
<cmath>
, <limits>
: Locally disable -Wnan-infinity-disabled
for Clang
#4990
Conversation
<limits>
: Locally disable -Wnan-infinity-disabled
for Clang<cmath>
, <limits>
: Locally disable -Wnan-infinity-disabled
for Clang
fda6ed1
to
fe88346
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppressing these warnings at template parse time while allowing them at instantiation is an excellent solution. I didn't know this was possible before.
Thanks! 😸 ♾️ @CaseyCarter I pushed a macro refactoring after you approved, moving them to |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
♾️ 🚫 #️⃣ |
Fixes #4931.
Possibly because of that
numeric_limits<FP>
are implemeted as full specializations, when one attempts usemin()
orepsilon()
, Clang emits warning for Nan and Inf related functions, even if these functions are not themselves called.This PR suppresses
-Wnan-infinity-disabled
in<limits>
and<cmath>
locally to avoid such false positives. When a user explicitly callsinfinity()
,quiet_NaN()
, orsignaling_NaN()
, the warning is still triggered (Godbolt link).