From: Argyrios Kyrtzidis Date: Tue, 24 Jun 2008 23:08:34 +0000 (+0000) Subject: 'Educate' IdentifierResolver about the declaration context of CXXFieldDecls. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32a5ba0d7dfc840c0558a625af26a184cf3bbb35;p=clang '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 cb5cac6190..4903adc685 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 @@ class IdentifierResolver { static DeclContext *getContext(Decl *D) { DeclContext *Ctx; + if (CXXFieldDecl *FD = dyn_cast(D)) + return FD->getParent(); + if (EnumConstantDecl *EnumD = dyn_cast(D)) { Ctx = EnumD->getDeclContext()->getParent(); } else if (ScopedDecl *SD = dyn_cast(D))