From 0cba85577ae613bce5768f3089003629a46b0e7f Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 20 Jan 2009 04:04:17 +0000 Subject: [PATCH] Fix Decl::NextDeclInScope access issue git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62567 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DeclBase.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.40.0