Skip to content

Conversation

mikolaj-pirog
Copy link
Member

@mikolaj-pirog mikolaj-pirog commented Aug 21, 2025

This makes clang emit warnings on code that does implicit vector conversions, like so:

__m512 a;
__m512d b;

a = b;

For more, see https://discourse.llvm.org/t/rfc-making-flax-vector-conversions-none-the-default/88008

Copy link

github-actions bot commented Aug 21, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions c,cpp -- clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaOverload.cpp clang/test/AST/ByteCode/builtin-bit-cast.cpp clang/test/CodeGen/AArch64/fp8-intrinsics/acle_neon_fp8_untyped.c clang/test/CodeGen/AArch64/sve-acle-__ARM_FEATURE_SVE_VECTOR_OPERATORS.c clang/test/CodeGen/AArch64/sve-acle-__ARM_FEATURE_SVE_VECTOR_OPERATORS.cpp clang/test/CodeGen/AArch64/targetattr-crypto.c clang/test/CodeGen/LoongArch/lasx/builtin-alias-error.c clang/test/CodeGen/LoongArch/lasx/builtin-error.c clang/test/CodeGen/LoongArch/lsx/builtin-alias-error.c clang/test/CodeGen/LoongArch/lsx/builtin-error.c clang/test/CodeGen/SystemZ/zvector.c clang/test/CodeGen/SystemZ/zvector2.c clang/test/CodeGen/builtins-mips-msa-error.c clang/test/CodeGen/target-builtin-error-3.c clang/test/CodeGen/vector.c clang/test/Sema/aarch64-neon-target.c clang/test/Sema/aarch64-neon-without-target-feature.cpp clang/test/Sema/arm-bfloat.cpp clang/test/Sema/arm-cde-immediates.c clang/test/Sema/arm-mve-immediates.c clang/test/Sema/arm-neon-target.c clang/test/Sema/arm-neon-types.c clang/test/Sema/arm64-neon-header.c clang/test/Sema/attr-arm-sve-vector-bits.c clang/test/Sema/attr-riscv-rvv-vector-bits.c clang/test/Sema/builtins-hvx-none.c clang/test/Sema/builtins-hvx-v60.c clang/test/Sema/builtins-hvx-v62.c clang/test/Sema/builtins-hvx-v65.c clang/test/Sema/builtins-mips-features.c clang/test/Sema/builtins-x86.c clang/test/Sema/constant-builtins-vector.cpp clang/test/Sema/conversion-64-32.c clang/test/Sema/conversion-implicit-int-includes-64-to-32.c clang/test/Sema/ext_vector_ops.c clang/test/Sema/overload-arm-mve.c clang/test/Sema/vector-assign.c clang/test/Sema/vector-cast.c clang/test/Sema/vector-gcc-compat.c clang/test/Sema/vector-gcc-compat.cpp clang/test/Sema/vector-init.c clang/test/Sema/vector-ops.c clang/test/SemaCXX/attr-arm-sve-vector-bits.cpp clang/test/SemaCXX/attr-riscv-rvv-vector-bits.cpp clang/test/SemaCXX/vector.cpp compiler-rt/lib/msan/tests/msan_test.cpp libcxx/test/std/experimental/simd/simd.class/simd_unary.pass.cpp

⚠️
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.
⚠️

View the diff from clang-format here.
diff --git a/compiler-rt/lib/msan/tests/msan_test.cpp b/compiler-rt/lib/msan/tests/msan_test.cpp
index 99ad2c31a..22a1405af 100644
--- a/compiler-rt/lib/msan/tests/msan_test.cpp
+++ b/compiler-rt/lib/msan/tests/msan_test.cpp
@@ -4132,8 +4132,8 @@ typedef U4 V2x32 __attribute__((__vector_size__(8)));
 typedef U2 V4x16 __attribute__((__vector_size__(8)));
 typedef U1 V8x8 __attribute__((__vector_size__(8)));
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecate-lax-vec-conv-all"
+#  pragma clang diagnostic push
+#  pragma clang diagnostic ignored "-Wdeprecate-lax-vec-conv-all"
 
 V8x16 shift_sse2_left_scalar(V8x16 x, U4 y) {
   return _mm_slli_epi16(x, y);
@@ -4349,7 +4349,7 @@ TEST(VectorCmpTest, builtin_ia32_ucomisdlt) {
   EXPECT_NOT_POISONED(c);
 }
 
-#pragma clang diagnostic push
+#  pragma clang diagnostic push
 
 #endif // defined(__x86_64__) && defined(__clang__)
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant