================ @@ -2835,6 +2835,9 @@ class Preprocessor { if (Identifier.getIdentifierInfo()->isRestrictExpansion() && !SourceMgr.isInMainFile(Identifier.getLocation())) emitRestrictExpansionWarning(Identifier); + + if (Identifier.getIdentifierInfo()->getName() == "INFINITY") ---------------- AaronBallman wrote:
We will? ``` #ifndef _HUGE_ENUF #define _HUGE_ENUF 1e+300 // _HUGE_ENUF*_HUGE_ENUF must overflow #endif #define INFINITY ((float)(_HUGE_ENUF * _HUGE_ENUF)) ... #define NAN ((float)(INFINITY * 0.0F)) ``` the multiplication for `INFINITY` won't form an actual infinity value in that case, so why would the multiplication with `0.0` not generate a NAN macro that folds to 0.0F? If use of `INFINITY` is undefined behavior when `-fno-honor-infinities` is passed... it makes sense to me that the definition of `NAN` using `INFINITY` is UB by the same logic. https://github.com/llvm/llvm-project/pull/76873 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits