[clang] [clang][Sema] Allow splat initialization of a sizeless vector in a C++ code (PR #205432)

Benjamin Maxwell via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 3 06:52:35 PDT 2026


================
@@ -8097,8 +8056,29 @@ bool Sema::CheckVectorCast(SourceRange R, QualType VectorTy, QualType Ty,
   return false;
 }
 
+static QualType getVectorElementType(ASTContext &Context, QualType VectorTy,
+                                     bool Unaltered) {
+  if (const auto *TyA = VectorTy->getAs<VectorType>())
+    return TyA->getElementType();
+  if (VectorTy->isSizelessVectorType()) {
+    if (Unaltered) {
----------------
MacDue wrote:

Don't include an option that's always going to be `true`. Just make this `getRawVectorElementType` or something (and remove the dead code paths).

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


More information about the cfe-commits mailing list