summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-07 11:51:51 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-07 11:51:51 +0000
commit8b2d2fe234163745794605ef643d60f0c4875207 (patch)
tree01f602455ca46905267e741786ccfd1c2cf2cfa8 /clang/lib/AST/ASTContext.cpp
parentbe051731054256489b3d8571009f059b6ae2c3b4 (diff)
downloadbcm5719-llvm-8b2d2fe234163745794605ef643d60f0c4875207.tar.gz
bcm5719-llvm-8b2d2fe234163745794605ef643d60f0c4875207.zip
Allow reference binding of a reference of Objective-C object type to
an lvalue of another, compatible Objective-C object type (e.g., a subclass). Introduce a new initialization sequence step kind to describe this binding, along with a new cast kind. Fixes PR7741. llvm-svn: 110513
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 22e1ebf5697..2c16c073483 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -4560,6 +4560,12 @@ bool ASTContext::areComparableObjCPointerTypes(QualType LHS, QualType RHS) {
canAssignObjCInterfaces(RHSOPT, LHSOPT);
}
+bool ASTContext::canBindObjCObjectType(QualType To, QualType From) {
+ return canAssignObjCInterfaces(
+ getObjCObjectPointerType(To)->getAs<ObjCObjectPointerType>(),
+ getObjCObjectPointerType(From)->getAs<ObjCObjectPointerType>());
+}
+
/// typesAreCompatible - C99 6.7.3p9: For two qualified types to be compatible,
/// both shall have the identically qualified version of a compatible type.
/// C99 6.2.7p1: Two types have compatible types if their types are the
OpenPOWER on IntegriCloud