Skip to content

[NFC][SemaHLSL] Fix typo causing float to double conversion #148941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025

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