]> granicus.if.org Git - clang/commitdiff
Sema::ActOnFinishFunctionBody(): Since we no longer synthesize a FunctionDecl for...
authorSteve Naroff <snaroff@apple.com>
Thu, 13 Dec 2007 18:18:56 +0000 (18:18 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 13 Dec 2007 18:18:56 +0000 (18:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45008 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaDecl.cpp

index b0c86f5c50f3ed4c9e36c4215eeb3bdca1fb933a..c3b6a8c4d234c6ad15086101d6e9b773c61f00fb 100644 (file)
@@ -1016,13 +1016,11 @@ Sema::DeclTy *Sema::ActOnFinishFunctionBody(DeclTy *D, StmtTy *Body) {
   if (FunctionDecl *FD = dyn_cast<FunctionDecl>(dcl)) {
     FD->setBody((Stmt*)Body);
     assert(FD == CurFunctionDecl && "Function parsing confused");
+    CurFunctionDecl = 0;
   } else if (ObjcMethodDecl *MD = dyn_cast<ObjcMethodDecl>(dcl)) {
     MD->setBody((Stmt*)Body);
     CurMethodDecl = 0;
-  }
-  // This is unconditional, since methods have a corresponding function decl.
-  CurFunctionDecl = 0;
-  
+  }  
   // Verify and clean out per-function state.
   
   // Check goto/label use.