From: Douglas Gregor Date: Tue, 20 Jan 2009 04:04:17 +0000 (+0000) Subject: Fix Decl::NextDeclInScope access issue X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0cba85577ae613bce5768f3089003629a46b0e7f;p=clang Fix Decl::NextDeclInScope access issue git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62567 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 20b0126bd7..35f929c12f 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -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; }