Skip to content

Commit 265c729

Browse files
committed
review: remove use of float.h for numeric_limits
1 parent 211850a commit 265c729

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clang/lib/Parse/ParseHLSLRootSignature.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include <float.h>
10-
119
#include "clang/Parse/ParseHLSLRootSignature.h"
1210

1311
#include "clang/Lex/LiteralSupport.h"
@@ -969,7 +967,8 @@ std::optional<float> RootSignatureParser::handleFloatLiteral(bool Negated) {
969967
Val = -Val;
970968

971969
double DoubleVal = Val.convertToDouble();
972-
if (FLT_MAX < DoubleVal || DoubleVal < -FLT_MAX) {
970+
double FloatMax = double(std::numeric_limits<float>::max());
971+
if (FloatMax < DoubleVal || DoubleVal < -FloatMax) {
973972
// Report that the value has overflowed
974973
PP.getDiagnostics().Report(CurToken.TokLoc,
975974
diag::err_hlsl_number_literal_overflow)

0 commit comments

Comments
 (0)