================
@@ -13861,6 +13897,36 @@ Sema::CheckReturnValExpr(Expr *RetValExp, QualType
lhsType,
CheckPPCMMAType(RetValExp->getType(), ReturnLoc);
}
+/// Diagnose comparison to NAN or INFINITY in fast math modes.
+/// The comparison to NaN or INFINITY is always false in
+/// fast modes: float evaluation will not result in inf or nan.
+void Sema::CheckInfNaNFloatComparison(SourceLocation Loc, Expr *LHS, Expr *RHS,
----------------
AaronBallman wrote:
Why are we on that path in the first place? The token length shouldn't be one
character long for either `inf` or `nan` right? I was thinking you should be
able to call `NumericLiteralParser::GetFloatValue()` within the `} else if
(Literal.isFloatingLiteral()) {` block to get an `APFloat` that you can call
`isInfinity()` or `isNaN()` on and then diagnose at that point.
https://github.com/llvm/llvm-project/pull/76873
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits