================
@@ -6784,6 +6784,12 @@ def warn_pointer_sub_null_ptr : Warning<
 def warn_floatingpoint_eq : Warning<
   "comparing floating point with == or != is unsafe">,
   InGroup<DiagGroup<"float-equal">>, DefaultIgnore;
+def warn_fast_floatingpoint_eq : Warning<
+  "%select{explicit comparison with|use of}0 %select{infinity|nan}1 "
+  "%select{will always return 'false'|as a function argument will not always 
be interpreted as such}0 "
+  "because %select{infinity|nan}1 will not be produced according to the "
+  "currently enabled floating-point options">,
----------------
AaronBallman wrote:

Ah, now that I better understand the scope of the functionality, I think we 
should go with:

`use of %select{infinity|NaN}0 results in undefined behavior due to the 
currently enabled floating-point options`

and move the diagnostic out of the tautological compare warning group. You 
should also update ExprConstant.cpp to reject use of inf/nan in a constant 
expression with the options disabled.

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

Reply via email to