[cfe-commits] r126268 - /cfe/trunk/include/clang/AST/DeclGroup.h

Richard Smith richard-llvm at metafoo.co.uk
Tue Feb 22 16:10:00 PST 2011


Author: rsmith
Date: Tue Feb 22 18:09:59 2011
New Revision: 126268

URL: http://llvm.org/viewvc/llvm-project?rev=126268&view=rev
Log:
DeclGroup's operator[] always returned the first Decl in the group.

Modified:
    cfe/trunk/include/clang/AST/DeclGroup.h

Modified: cfe/trunk/include/clang/AST/DeclGroup.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclGroup.h?rev=126268&r1=126267&r2=126268&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclGroup.h (original)
+++ cfe/trunk/include/clang/AST/DeclGroup.h Tue Feb 22 18:09:59 2011
@@ -39,12 +39,12 @@
 
   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];
   }
 };
 





More information about the cfe-commits mailing list