[clang] [HLSL] Compatibility overloads for scalar min/max (PR #222746)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 11:50:05 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h -- clang/lib/Headers/hlsl/hlsl_compat_overloads.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Headers/hlsl/hlsl_compat_overloads.h b/clang/lib/Headers/hlsl/hlsl_compat_overloads.h
index 50d1c07e9..cd6b302ea 100644
--- a/clang/lib/Headers/hlsl/hlsl_compat_overloads.h
+++ b/clang/lib/Headers/hlsl/hlsl_compat_overloads.h
@@ -522,14 +522,10 @@ constexpr __detail::enable_if_t<(N > 1 && N <= 4), vector<T, N>> max(
 }
 
 _DXC_DEPRECATED_SCALAR_FN(float, int, max)
-constexpr float max(float p0, int p1) {
-  return max(p0, (float)p1);
-}
+constexpr float max(float p0, int p1) { return max(p0, (float)p1); }
 
 _DXC_DEPRECATED_SCALAR_FN(int, float, max)
-constexpr float max(int p0, float p1) {
-  return max((float)p0, p1);
-}
+constexpr float max(int p0, float p1) { return max((float)p0, p1); }
 
 //===----------------------------------------------------------------------===//
 // min builtins overloads
@@ -550,14 +546,10 @@ constexpr __detail::enable_if_t<(N > 1 && N <= 4), vector<T, N>> min(
 }
 
 _DXC_DEPRECATED_SCALAR_FN(float, int, max)
-constexpr float min(float p0, int p1) {
-  return min(p0, (float)p1);
-}
+constexpr float min(float p0, int p1) { return min(p0, (float)p1); }
 
 _DXC_DEPRECATED_SCALAR_FN(int, float, max)
-constexpr float min(int p0, float p1) {
-  return min((float)p0, p1);
-}
+constexpr float min(int p0, float p1) { return min((float)p0, p1); }
 
 //===----------------------------------------------------------------------===//
 // normalize builtins overloads

``````````

</details>


https://github.com/llvm/llvm-project/pull/222746


More information about the cfe-commits mailing list