summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaExpr.cpp2
-rw-r--r--clang/test/Sema/block-misc.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 57902cc02b5..fa857575c5d 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -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???
}
diff --git a/clang/test/Sema/block-misc.c b/clang/test/Sema/block-misc.c
index 8775aa752ac..bef2662bbcd 100644
--- a/clang/test/Sema/block-misc.c
+++ b/clang/test/Sema/block-misc.c
@@ -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}}
-}
-
OpenPOWER on IntegriCloud