[cfe-commits] r39049 - in /cfe/cfe/trunk: AST/Sema.cpp Sema/Sema.cpp

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:27:07 PDT 2007


Author: sabre
Date: Wed Jul 11 11:27:07 2007
New Revision: 39049

URL: http://llvm.org/viewvc/llvm-project?rev=39049&view=rev
Log:
only add to LastInGroupList if at the top-level.

Modified:
    cfe/cfe/trunk/AST/Sema.cpp
    cfe/cfe/trunk/Sema/Sema.cpp

Modified: cfe/cfe/trunk/AST/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Sema.cpp?rev=39049&r1=39048&r2=39049&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Sema.cpp (original)
+++ cfe/cfe/trunk/AST/Sema.cpp Wed Jul 11 11:27:07 2007
@@ -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;
 }

Modified: cfe/cfe/trunk/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/Sema.cpp?rev=39049&r1=39048&r2=39049&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/Sema.cpp (original)
+++ cfe/cfe/trunk/Sema/Sema.cpp Wed Jul 11 11:27:07 2007
@@ -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;
 }





More information about the cfe-commits mailing list