aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaCast.cpp
diff options
context:
space:
mode:
authorSaurabh Jha <saurabh.jhaa@gmail.com>2021-05-04 13:44:58 +0100
committerFlorian Hahn <flo@fhahn.com>2021-05-04 15:27:57 +0100
commitdb210bc69bb50979fb843b68fcb71a9c905e971b (patch)
tree1ae705453015eed89ee20ffa79f1f12720a394c9 /clang/lib/Sema/SemaCast.cpp
parentd7ec48d71bd67118e7996c45e9c7fb1b09d4f59a (diff)
downloadllvm-db210bc69bb50979fb843b68fcb71a9c905e971b.zip
llvm-db210bc69bb50979fb843b68fcb71a9c905e971b.tar.gz
llvm-db210bc69bb50979fb843b68fcb71a9c905e971b.tar.bz2
[Matrix] Implement C-style explicit type conversions in CXX for matrix types
This patch implements C-style explicit type conversions in CXX for matrix types. It is part of fixing https://bugs.llvm.org/show_bug.cgi?id=47141 Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D101696
Diffstat (limited to 'clang/lib/Sema/SemaCast.cpp')
-rw-r--r--clang/lib/Sema/SemaCast.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp
index d347975..8a9ee1a 100644
--- a/clang/lib/Sema/SemaCast.cpp
+++ b/clang/lib/Sema/SemaCast.cpp
@@ -2648,6 +2648,13 @@ void CastOperation::CheckCXXCStyleCast(bool FunctionalStyle,
return;
}
+ if (DestType->getAs<MatrixType>() ||
+ SrcExpr.get()->getType()->getAs<MatrixType>()) {
+ if (Self.CheckMatrixCast(OpRange, DestType, SrcExpr.get()->getType(), Kind))
+ SrcExpr = ExprError();
+ return;
+ }
+
// AltiVec vector initialization with a single literal.
if (const VectorType *vecTy = DestType->getAs<VectorType>())
if (vecTy->getVectorKind() == VectorType::AltiVecVector