]> granicus.if.org Git - clang/commitdiff
'Educate' IdentifierResolver about the declaration context of CXXFieldDecls.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 24 Jun 2008 23:08:34 +0000 (23:08 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 24 Jun 2008 23:08:34 +0000 (23:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52698 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/IdentifierResolver.h

index cb5cac61905a7886e7bf32446a1830c25da00c4f..4903adc685f53f61fbb3f82bab44ba18002e5455 100644 (file)
@@ -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))