aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-02-23 23:41:11 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-02-23 23:41:11 +0000
commitf914b9782a6091a7c7dfd41b0a273ee724351b84 (patch)
treeaf7ca1123cfed1c2a5c786b581ea96d282d6106b /lib/Sema/SemaDecl.cpp
parent70c23cdf12822edbbd04901f80133b2db9728226 (diff)
More Sema check for ivars in class continuation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 0be3841ad5..27eb2510ec 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -5659,21 +5659,8 @@ void Sema::ActOnFields(Scope* S,
}
// Must enforce the rule that ivars in the base classes may not be
// duplicates.
- if (ID->getSuperClass()) {
- for (ObjCInterfaceDecl::ivar_iterator IVI = ID->ivar_begin(),
- IVE = ID->ivar_end(); IVI != IVE; ++IVI) {
- ObjCIvarDecl* Ivar = (*IVI);
-
- if (IdentifierInfo *II = Ivar->getIdentifier()) {
- ObjCIvarDecl* prevIvar =
- ID->getSuperClass()->lookupInstanceVariable(II);
- if (prevIvar) {
- Diag(Ivar->getLocation(), diag::err_duplicate_member) << II;
- Diag(prevIvar->getLocation(), diag::note_previous_declaration);
- }
- }
- }
- }
+ if (ID->getSuperClass())
+ DiagnoseDuplicateIvars(ID, ID->getSuperClass());
} else if (ObjCImplementationDecl *IMPDecl =
dyn_cast<ObjCImplementationDecl>(EnclosingDecl)) {
assert(IMPDecl && "ActOnFields - missing ObjCImplementationDecl");