[clang] [llvm] [clang-tools-extra] [CLANG] Add warning when INF or NAN are used in a binary operation or as function argument in fast math mode. (PR #76873)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 06:55:33 PST 2024


================
@@ -2835,6 +2835,9 @@ class Preprocessor {
     if (Identifier.getIdentifierInfo()->isRestrictExpansion() &&
         !SourceMgr.isInMainFile(Identifier.getLocation()))
       emitRestrictExpansionWarning(Identifier);
+
+    if (Identifier.getIdentifierInfo()->getName() == "INFINITY")
----------------
AaronBallman wrote:

What about `NAN`?

https://github.com/llvm/llvm-project/pull/76873


More information about the cfe-commits mailing list