]> granicus.if.org Git - clang/commitdiff
BlockDecl node must be complete before block attributes
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 18 May 2009 23:17:46 +0000 (23:17 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 18 May 2009 23:17:46 +0000 (23:17 +0000)
can be processed. No change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72066 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 0caad654ee0170f88b88ec33452f456598e99fe8..418b3b8ce0566cdded56134a1eb8ba0c1eeab5d7 100644 (file)
@@ -5075,10 +5075,9 @@ void Sema::ActOnBlockStart(SourceLocation CaretLoc, Scope *BlockScope) {
 void Sema::ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
   assert(ParamInfo.getIdentifier()==0 && "block-id should have no identifier!");
 
-  ProcessDeclAttributes(CurBlock->TheDecl, ParamInfo);
-
   if (ParamInfo.getNumTypeObjects() == 0
       || ParamInfo.getTypeObject(0).Kind != DeclaratorChunk::Function) {
+    ProcessDeclAttributes(CurBlock->TheDecl, ParamInfo);
     QualType T = GetTypeForDeclarator(ParamInfo, CurScope);
 
     if (T->isArrayType()) {
@@ -5134,6 +5133,7 @@ void Sema::ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
   CurBlock->TheDecl->setParams(Context, &CurBlock->Params[0], 
                                CurBlock->Params.size());
 
+  ProcessDeclAttributes(CurBlock->TheDecl, ParamInfo);
   for (BlockDecl::param_iterator AI = CurBlock->TheDecl->param_begin(),
        E = CurBlock->TheDecl->param_end(); AI != E; ++AI)
     // If this has an identifier, add it to the scope stack.