 +          return false;
 +
 +        for (size_t i = 0; i < LDG.size(); ++i)
-+          if (LDG[i] != RDG[i])
++          if (LDG[i] != RDG[i] || LDG[i]->getKind() != RDG[i]->getKind())
 +            return false;
 +
 +        return true;

+    }      
+    return false;
+  }
 };
 
 } // end clang namespace

Index: tools/clang/lib/AST/DeclGroup.cpp
===================================================================
--- tools/clang/lib/AST/DeclGroup.cpp	(revision 160362)
+++ tools/clang/lib/AST/DeclGroup.cpp	(working copy)
@@ -15,18 +15,40 @@
 #include "clang/AST/Decl.h"
 #include "clang/AST/ASTContext.h"
 #include "llvm/Support/Allocator.h"
-using namespace clang;
 
-DeclGroup* DeclGroup::Create(ASTContext &C, Decl **Decls, unsigned NumDecls) {
-  assert(NumDecls > 1 && "Invalid DeclGroup");
-  unsigned Size = sizeof(DeclGroup) + sizeof(Decl*) * NumDecls;
-  void* Mem = C.Allocate(Size, llvm::AlignOf<DeclGroup>::Alignment);
-  new (Mem) DeclGroup(NumDecls, Decls);
-  return static_cast<DeclGroup*>(Mem);
-}
+namespace clang {
+  DeclGroup* DeclGroup::Create(ASTContext &C, Decl **Decls, unsigned NumDecls) {
+    assert(NumDecls > 1 && "Invalid DeclGroup");
+    unsigned Size = sizeof(DeclGroup) + sizeof(Decl*) * NumDecls;
+    void* Mem = C.Allocate(Size, llvm::AlignOf<DeclGroup>::Alignment);
+    new (Mem) DeclGroup(NumDecls, Decls);
+    return static_cast<DeclGroup*>(Mem);
+  }
 
-DeclGroup::DeclGroup(unsigned numdecls, Decl** decls) : NumDecls(numdecls) {
-  assert(numdecls > 0);
-  assert(decls);
-  memcpy(this+1, decls, numdecls * sizeof(*decls));
-}
+  DeclGroup::DeclGroup(unsigned numdecls, Decl** decls) : NumDecls(numdecls) {
+    assert(numdecls > 0);
+    assert(decls);
+    memcpy(this+1, decls, numdecls * sizeof(*decls));
+  }
+
+  bool operator==(const DeclGroupRef LHS, const DeclGroupRef RHS) {
+    if (LHS.D == RHS.D) {
+      if (LHS.isSingleDecl() && RHS.isSingleDecl())
+        return LHS.D->getKind() == RHS.D->getKind();
+
+      if (LHS.isDeclGroup() && RHS.isDeclGroup()){
+        const DeclGroup &LDG = LHS.getDeclGroup();
