[clang-tools-extra] [llvm] [clang] [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


================
@@ -70,6 +70,10 @@ def warn_pragma_debug_missing_argument : Warning<
 def warn_pragma_debug_unexpected_argument : Warning<
   "unexpected argument to debug command">, InGroup<IgnoredPragmas>;
 
+def warn_fp_nan_inf_when_disabled : Warning<
+  "use of %select{infinity|NaN}0 %select{|via a macro}1 results in an undefined behavior "
----------------
AaronBallman wrote:

```suggestion
  "use of %select{infinity|NaN}0%select{| via a macro}1 results in undefined behavior "
```
How about this?

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


More information about the cfe-commits mailing list