]> granicus.if.org Git - clang/commitdiff
DeclGroup's operator[] always returned the first Decl in the group.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 23 Feb 2011 00:09:59 +0000 (00:09 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 23 Feb 2011 00:09:59 +0000 (00:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126268 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclGroup.h

index cb9e1681cc06f64d4af7158893397a525373905d..63cdac594920af20b41ae96721355e38c21b9d9a 100644 (file)
@@ -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];
   }
 };