only add to LastInGroupList if at the top-level.

llvm-svn: 39049
diff --git a/clang/Sema/Sema.cpp b/clang/Sema/Sema.cpp
index fe833aa..17fa8d3 100644
--- a/clang/Sema/Sema.cpp
+++ b/clang/Sema/Sema.cpp
@@ -147,7 +147,10 @@
     S->AddDecl(II);
   }
   
-  if (LastInGroup) LastInGroupList.push_back((Decl*)LastInGroup);
+  // If this is a top-level decl that is chained to some other (e.g. int A,B,C;)
+  // remember this in the LastInGroupList list.
+  if (LastInGroup && S->getParent() == 0)
+    LastInGroupList.push_back((Decl*)LastInGroup);
   
   return New;
 }