This patch concludes implementation of dynamic objective-c type qualified by
protocol list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45203 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp
index 8eedd37..bf5d71f 100644
--- a/Sema/SemaExpr.cpp
+++ b/Sema/SemaExpr.cpp
@@ -1103,6 +1103,8 @@
///
Sema::AssignmentCheckResult
Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) {
+
+
if (lhsType.getCanonicalType().getUnqualifiedType() ==
rhsType.getCanonicalType().getUnqualifiedType())
return Compatible; // common case, fast path...
@@ -1110,7 +1112,13 @@
if (lhsType->isReferenceType() || rhsType->isReferenceType()) {
if (Context.referenceTypesAreCompatible(lhsType, rhsType))
return Compatible;
- } else if (lhsType->isArithmeticType() && rhsType->isArithmeticType()) {
+ }
+ else if (lhsType->isObjcQualifiedIdType()
+ || rhsType->isObjcQualifiedIdType()) {
+ if (Context.ObjcQualifiedIdTypesAreCompatible(lhsType, rhsType))
+ return Compatible;
+ }
+ else if (lhsType->isArithmeticType() && rhsType->isArithmeticType()) {
if (lhsType->isVectorType() || rhsType->isVectorType()) {
if (!getLangOptions().LaxVectorConversions) {
if (lhsType.getCanonicalType() != rhsType.getCanonicalType())