Fix rdar://6814047, a crash on invalid in blocks code I noticed when

working on the previous fix.

llvm-svn: 69742
This commit is contained in:
Chris Lattner
2009-04-21 22:38:46 +00:00
parent 35f875c136
commit 41b8694777
2 changed files with 8 additions and 7 deletions

View File

@@ -4755,8 +4755,8 @@ void Sema::ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
CurFunctionNeedsScopeChecking = CurBlock->SavedFunctionNeedsScopeChecking;
// Pop off CurBlock, handle nested blocks.
PopDeclContext();
CurBlock = CurBlock->PrevBlockInfo;
// FIXME: Delete the ParmVarDecl objects as well???
}

View File

@@ -112,6 +112,13 @@ void test11(int i) {
^{ break; }(); // expected-error {{'break' statement not in loop or switch statement}}
}
void (^test12f)(void);
void test12() {
test12f = ^test12f; // expected-error {{type name requires a specifier or qualifier}} expected-error {{expected expression}}
}
// rdar://6808730
void *test13 = ^{
int X = 32;
@@ -131,9 +138,3 @@ void test14() {
};
};
}
void (^test12f)(void);
void test12() {
test12f = ^test12f; // expected-error {{type name requires a specifier or qualifier}} expected-error {{expected expression}}
}