[clang] [NFC][SemaHLSL] Fix typo causing float to double conversion (PR #148941)

Finn Plummer via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 15 12:37:19 PDT 2025


https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/148941

- it was noted, [here](https://github.com/llvm/llvm-project/pull/145795#discussion_r2208118547), that by accidently not specifying this explicitly as a float it will cause a build warning on MSVC

- this commit resolves this by explicitly specifying it as a float

>From 63fb3a17c884e6a59bc73e340c7472618e31904f Mon Sep 17 00:00:00 2001
From: Finn Plummer <canadienfinn at gmail.com>
Date: Tue, 15 Jul 2025 19:35:56 +0000
Subject: [PATCH] [NFC][SemaHLSL] Fix typo causing float to double conversion

- it was noted, here, that by accidently not specifying this explicitly
as a float it will cause a build warning on MSVC

- this commit resolves this by explicitly specifying it as a float
---
 clang/lib/Sema/SemaHLSL.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Sema/SemaHLSL.cpp b/clang/lib/Sema/SemaHLSL.cpp
index 4875c25c76988..9276554bebf9d 100644
--- a/clang/lib/Sema/SemaHLSL.cpp
+++ b/clang/lib/Sema/SemaHLSL.cpp
@@ -1150,7 +1150,7 @@ bool SemaHLSL::handleRootSignatureElements(
       if (!llvm::hlsl::rootsig::verifyMaxAnisotropy(Sampler->MaxAnisotropy))
         ReportError(Loc, 0, 16);
       if (!llvm::hlsl::rootsig::verifyMipLODBias(Sampler->MipLODBias))
-        ReportFloatError(Loc, -16.f, 15.99);
+        ReportFloatError(Loc, -16.f, 15.99f);
     } else if (const auto *Clause =
                    std::get_if<llvm::hlsl::rootsig::DescriptorTableClause>(
                        &Elem)) {



More information about the cfe-commits mailing list