Skip to content

Conversation

inbelic
Copy link
Contributor

@inbelic inbelic commented Jul 15, 2025

  • 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

- 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
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support labels Jul 15, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 15, 2025

@llvm/pr-subscribers-clang

Author: Finn Plummer (inbelic)

Changes
  • 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


Full diff: https://github.com/llvm/llvm-project/pull/148941.diff

1 Files Affected:

  • (modified) clang/lib/Sema/SemaHLSL.cpp (+1-1)
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)) {

@llvmbot
Copy link
Member

llvmbot commented Jul 15, 2025

@llvm/pr-subscribers-hlsl

Author: Finn Plummer (inbelic)

Changes
  • 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


Full diff: https://github.com/llvm/llvm-project/pull/148941.diff

1 Files Affected:

  • (modified) clang/lib/Sema/SemaHLSL.cpp (+1-1)
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)) {

@inbelic inbelic merged commit 8d61073 into llvm:main Jul 15, 2025
14 checks passed
@inbelic inbelic deleted the inbelic/rs-fix-typo branch July 23, 2025 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category HLSL HLSL Language Support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants