'Educate' IdentifierResolver about the declaration context of CXXFieldDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52698 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/IdentifierResolver.h b/lib/Sema/IdentifierResolver.h
index cb5cac6..4903adc 100644
--- a/lib/Sema/IdentifierResolver.h
+++ b/lib/Sema/IdentifierResolver.h
@@ -18,6 +18,7 @@
 #include "clang/Basic/IdentifierTable.h"
 #include "clang/Parse/Scope.h"
 #include "clang/AST/Decl.h"
+#include "clang/AST/DeclCXX.h"
 
 namespace clang {
 
@@ -45,6 +46,9 @@
     static DeclContext *getContext(Decl *D) {
       DeclContext *Ctx;
 
+      if (CXXFieldDecl *FD = dyn_cast<CXXFieldDecl>(D))
+        return FD->getParent();
+
       if (EnumConstantDecl *EnumD = dyn_cast<EnumConstantDecl>(D)) {
         Ctx = EnumD->getDeclContext()->getParent();
       } else if (ScopedDecl *SD = dyn_cast<ScopedDecl>(D))