From: Richard Smith Date: Wed, 23 Feb 2011 00:09:59 +0000 (+0000) Subject: DeclGroup's operator[] always returned the first Decl in the group. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b80f66847d103aee7988b791a380fc563bf89a19;p=clang 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 --- 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]; } };