From 7671e53b668093edbf3f20fc5e43a341626c743a Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 16 Dec 2011 16:34:57 +0000 Subject: If there is a definition of an ObjCInterfaceDecl, make it the Decl returned from the corresponding ObjCInterfaceType llvm-svn: 146740 --- clang/lib/AST/DeclObjC.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'clang/lib/AST/DeclObjC.cpp') diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 317dc95f540..02cc988d82d 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -225,7 +225,11 @@ void ObjCInterfaceDecl::mergeClassExtensionProtocolList( void ObjCInterfaceDecl::allocateDefinitionData() { assert(!hasDefinition() && "ObjC class already has a definition"); Data = new (getASTContext()) DefinitionData(); - Data->Definition = this; + Data->Definition = this; + + // Make the type point at the definition, now that we have one. + if (TypeForDecl) + cast(TypeForDecl)->Decl = this; } void ObjCInterfaceDecl::startDefinition() { -- cgit v1.2.3