isnan() is not working with AppleClang 12.0.0.12000022

I have a bunch of code that uses std::numericlimits<float>::quietNaN() and in some places I make checks like isnan(...). In Debug everything is fine but in Release isnan() does not work as expected and returns false even when a NAN is passed to isnan() function. Does anyone else have this problem? Is there some deprecation that Iam missing or some new compiler flag?
I had a similar problem. In my case the behaviour of the isnan() was changed by the -ffast-math compiler flag. See clang.llvm.org/docs/UsersManual.html#cmdoption-ffast-math where it is stated :

 This option lets the compiler make aggressive, potentially-lossy assumptions about floating-point math. These include:
...
Operands to floating-point operations are not equal to NaN and Inf, and


isnan() is not working with AppleClang 12.0.0.12000022
 
 
Q