[clang-tools-extra] [clang] [llvm] [HLSL] Vector standard conversions (PR #71098)

John McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 19 11:57:37 PST 2023


================
@@ -15608,11 +15608,18 @@ static void CheckImplicitConversion(Sema &S, Expr *E, QualType T,
       if (S.SourceMgr.isInSystemMacro(CC))
         return;
       return DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_vector_scalar);
+    } else if (S.getLangOpts().HLSL &&
+               Target->getAs<VectorType>()->getNumElements() <
+                   Source->getAs<VectorType>()->getNumElements()) {
----------------
rjmccall wrote:

You can use `cast<VectorType>` here, since we're working with canonical types.

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


More information about the cfe-commits mailing list