From b80f66847d103aee7988b791a380fc563bf89a19 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 23 Feb 2011 00:09:59 +0000 Subject: [PATCH] DeclGroup's operator[] always returned the first Decl in the group. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126268 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DeclGroup.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/clang/AST/DeclGroup.h b/include/clang/AST/DeclGroup.h index cb9e1681cc..63cdac5949 100644 --- a/include/clang/AST/DeclGroup.h +++ b/include/clang/AST/DeclGroup.h @@ -39,12 +39,12 @@ public: Decl*& operator[](unsigned i) { assert (i < NumDecls && "Out-of-bounds access."); - return *((Decl**) (this+1)); + return ((Decl**) (this+1))[i]; } Decl* const& operator[](unsigned i) const { assert (i < NumDecls && "Out-of-bounds access."); - return *((Decl* const*) (this+1)); + return ((Decl* const*) (this+1))[i]; } }; -- 2.50.1