aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-01-12 22:12:08 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-01-12 22:12:08 +0000
commitf2b4f7b6772ccba2ea8aae411ea09d8d32d90015 (patch)
tree7e642114c01b7cfa5fd5bc935f597371905f6497 /lib/Sema
parentb29d3e73aa23328be00df5d721ef751f4a609c29 (diff)
objc: do not warn when converting to a const id qualfied by its
list of protools. // rdar://10669694 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaExpr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index ceb836b3e8..8625d9b260 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -5304,7 +5304,9 @@ checkObjCPointerTypesForAssignment(Sema &S, QualType LHSType,
QualType lhptee = LHSType->getAs<ObjCObjectPointerType>()->getPointeeType();
QualType rhptee = RHSType->getAs<ObjCObjectPointerType>()->getPointeeType();
- if (!lhptee.isAtLeastAsQualifiedAs(rhptee))
+ if (!lhptee.isAtLeastAsQualifiedAs(rhptee) &&
+ // make an exception for id<P>
+ !LHSType->isObjCQualifiedIdType())
return Sema::CompatiblePointerDiscardsQualifiers;
if (S.Context.typesAreCompatible(LHSType, RHSType))