diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/ParseAST.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/Sema/ParseAST.cpp b/lib/Sema/ParseAST.cpp index 9afc8100c7..18ab092102 100644 --- a/lib/Sema/ParseAST.cpp +++ b/lib/Sema/ParseAST.cpp @@ -71,6 +71,9 @@ void clang::ParseAST(Preprocessor &PP, ASTConsumer *Consumer, if (ADecl) Consumer->HandleTopLevelDecl(ADecl.getAsVal<DeclGroupRef>()); }; + // Check for any pending objective-c implementation decl. + while (ADecl = P.RetreivePendingObjCImpDecl()) + Consumer->HandleTopLevelDecl(ADecl.getAsVal<DeclGroupRef>()); // process any TopLevelDecls generated by #pragma weak for (llvm::SmallVector<Decl*,2>::iterator diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index e4482804dd..d1b40bed0f 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1559,12 +1559,17 @@ void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclPtrTy classDecl, // should be true. if (!ClassDecl) return; - + bool isInterfaceDeclKind = isa<ObjCInterfaceDecl>(ClassDecl) || isa<ObjCCategoryDecl>(ClassDecl) || isa<ObjCProtocolDecl>(ClassDecl); bool checkIdenticalMethods = isa<ObjCImplementationDecl>(ClassDecl); + if (!isInterfaceDeclKind && AtEndLoc.isInvalid()) { + AtEndLoc = ClassDecl->getLocation(); + Diag(AtEndLoc, diag::warn_missing_atend); + } + DeclContext *DC = dyn_cast<DeclContext>(ClassDecl); // FIXME: Remove these and use the ObjCContainerDecl/DeclContext. |