diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-06-24 23:08:34 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-06-24 23:08:34 +0000 |
commit | ac1b916441f02bf7a26f8337c9d41692a5139529 (patch) | |
tree | 89ca2afee62b203658263442d59e891f066a66c9 /clang/lib/Sema/IdentifierResolver.h | |
parent | 1492538fd1b43034a1e8bb8b7c8307131fa1a8d3 (diff) | |
download | bcm5719-llvm-ac1b916441f02bf7a26f8337c9d41692a5139529.tar.gz bcm5719-llvm-ac1b916441f02bf7a26f8337c9d41692a5139529.zip |
'Educate' IdentifierResolver about the declaration context of CXXFieldDecls.
llvm-svn: 52698
Diffstat (limited to 'clang/lib/Sema/IdentifierResolver.h')
-rw-r--r-- | clang/lib/Sema/IdentifierResolver.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/IdentifierResolver.h b/clang/lib/Sema/IdentifierResolver.h index cb5cac61905..4903adc685f 100644 --- a/clang/lib/Sema/IdentifierResolver.h +++ b/clang/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<CXXFieldDecl>(D)) + return FD->getParent(); + if (EnumConstantDecl *EnumD = dyn_cast<EnumConstantDecl>(D)) { Ctx = EnumD->getDeclContext()->getParent(); } else if (ScopedDecl *SD = dyn_cast<ScopedDecl>(D)) |