]> granicus.if.org Git - clang/commitdiff
Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when processing the...
authorTed Kremenek <kremenek@apple.com>
Mon, 6 Oct 2008 20:59:48 +0000 (20:59 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 6 Oct 2008 20:59:48 +0000 (20:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57209 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjC.cpp

index c389adba58479b5353134bf7090efc4e6d29c574..9849fb61b6b50b93f01ece66bf2c7935606e8064 100644 (file)
@@ -342,9 +342,9 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S)
 
   if (const DeclStmt *SD = dyn_cast<DeclStmt>(S.getElement())) {
     EmitStmt(SD);
-    
-    ElementTy = cast<ValueDecl>(SD->getDecl())->getType();
-    DeclAddress = LocalDeclMap[SD->getDecl()];    
+    const ScopedDecl* D = SD->getSolitaryDecl();
+    ElementTy = cast<ValueDecl>(D)->getType();
+    DeclAddress = LocalDeclMap[D];    
   } else {
     ElementTy = cast<Expr>(S.getElement())->getType();
     DeclAddress = 0;