aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r--lib/AST/DeclObjC.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 85b8ec14e0..1b098b5f89 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -220,13 +220,14 @@ ObjCPropertyDecl *ObjCPropertyDecl::Create(ASTContext &C,
// Objective-C Decl Implementation
//===----------------------------------------------------------------------===//
-void ObjCMethodDecl::createImplicitParams(ASTContext &Context) {
+void ObjCMethodDecl::createImplicitParams(ASTContext &Context,
+ const ObjCInterfaceDecl *OID) {
QualType selfTy;
if (isInstance()) {
// There may be no interface context due to error in declaration
// of the interface (which has been reported). Recover gracefully.
- if (ObjCInterfaceDecl *OID = getClassInterface()) {
- selfTy = Context.getObjCInterfaceType(OID);
+ if (OID) {
+ selfTy = Context.getObjCInterfaceType(const_cast<ObjCInterfaceDecl *>(OID));
selfTy = Context.getPointerType(selfTy);
} else {
selfTy = Context.getObjCIdType();