diff options
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 2d3d36f..b41d943 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -12051,7 +12051,16 @@ static void CheckImplicitConversion(Sema &S, Expr *E, QualType T, checkObjCDictionaryLiteral(S, QualType(Target, 0), DictionaryLiteral); // Strip vector types. - if (isa<VectorType>(Source)) { + if (const auto *SourceVT = dyn_cast<VectorType>(Source)) { + if (Target->isVLSTBuiltinType()) { + auto SourceVectorKind = SourceVT->getVectorKind(); + if (SourceVectorKind == VectorType::SveFixedLengthDataVector || + SourceVectorKind == VectorType::SveFixedLengthPredicateVector || + (SourceVectorKind == VectorType::GenericVector && + S.Context.getTypeSize(Source) == S.getLangOpts().ArmSveVectorBits)) + return; + } + if (!isa<VectorType>(Target)) { if (S.SourceMgr.isInSystemMacro(CC)) return; |