diff options
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 9314134161..ba35333fe5 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1339,14 +1339,16 @@ void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclTy *classDecl, } } } - llvm::SmallVector<VarDecl*, 8> allTUVariables; - for (unsigned i = 0; i < tuvNum; i++) { - if (VarDecl *VD = dyn_cast<VarDecl>((Decl*)allTUVars[i])) - allTUVariables.push_back(VD); - } - if (!allTUVariables.empty() && isInterfaceDeclKind) { - ObjCContainerDecl *OCD = dyn_cast<ObjCContainerDecl>(ClassDecl); - OCD->setTUVarList(&allTUVariables[0], allTUVariables.size(), Context); + if (isInterfaceDeclKind) + for (unsigned i = 0; i < tuvNum; i++) { + if (VarDecl *VDecl = dyn_cast<VarDecl>((Decl*)allTUVars[i])) { + if (VDecl->getStorageClass() != VarDecl::Extern && + VDecl->getStorageClass() != VarDecl::PrivateExtern) { + NamedDecl *ClassNameDecl = dyn_cast<NamedDecl>(ClassDecl); + Diag(VDecl->getLocation(), diag::err_objc_var_decl_inclass) + << ClassNameDecl->getIdentifier(); + } + } } } |