]> granicus.if.org Git - clang/commitdiff
Fix Decl::NextDeclInScope access issue
authorDouglas Gregor <dgregor@apple.com>
Tue, 20 Jan 2009 04:04:17 +0000 (04:04 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 20 Jan 2009 04:04:17 +0000 (04:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62567 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclBase.h

index 20b0126bd753bd3ff66123cca092fe03133c5831..35f929c12f7c84af6d1ea529707a7435093cb4b9 100644 (file)
@@ -457,6 +457,8 @@ class DeclContext {
   /// DenseMap. Othewise, it is an array.
   bool isLookupMap() const { return LookupPtr.getInt() == LookupIsMap; }
 
+  static Decl *getNextDeclInScope(Decl *D) { return D->NextDeclInScope; }
+
 protected:
    DeclContext(Decl::Kind K) 
      : DeclKind(K), LookupPtr(), FirstDecl(0), LastDecl(0) { }
@@ -809,7 +811,7 @@ inline bool Decl::isDefinedOutsideFunctionOrMethod() const {
 }
 
 inline DeclContext::decl_iterator& DeclContext::decl_iterator::operator++() {
-  Current = Current->NextDeclInScope;
+  Current = getNextDeclInScope(Current);
   return *this;
 }