aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 040c5467ac..c7a45dc9d7 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3952,7 +3952,12 @@ void Sema::ActOnFields(Scope* S,
} else if (ObjCImplementationDecl *IMPDecl =
dyn_cast<ObjCImplementationDecl>(EnclosingDecl)) {
assert(IMPDecl && "ActOnFields - missing ObjCImplementationDecl");
- IMPDecl->setIVarList(ClsFields, RecFields.size(), Context);
+ for (unsigned I = 0, N = RecFields.size(); I != N; ++I) {
+ // FIXME: Set the DeclContext correctly when we build the
+ // declarations.
+ ClsFields[I]->setLexicalDeclContext(IMPDecl);
+ IMPDecl->addDecl(Context, ClsFields[I]);
+ }
CheckImplementationIvars(IMPDecl, ClsFields, RecFields.size(), RBrac);
}
}