Reimplement fix for <rdar://problem/6451399> problems with labels and blocks.

This solution is much simpler (and doesn't add any per-scope overhead, which concerned Chris). 

The only downside is the LabelMap is now declared in two places (Sema and BlockSemaInfo). My original fix tried to unify the LabelMap in "Scope" (which would support nested functions in general). In any event, this fixes the bug given the current language definition. If/when we decide to support GCC style nested functions, this will need to be tweaked.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66896 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/block-labels.c b/test/Sema/block-labels.c
index e69de29..15e6f61 100644
--- a/test/Sema/block-labels.c
+++ b/test/Sema/block-labels.c
@@ -0,0 +1,17 @@
+// RUN: clang %s -verify -fblocks -fsyntax-only
+
+int a() { 
+  A:if (1) xx();
+  return ^{A:return 1;}();
+}
+int b() { 
+  A: return ^{int a; A:return 1;}();
+}
+
+int d() { 
+  A: return ^{int a; A: a = ^{int a; A:return 1;}() + ^{int b; A:return 2;}(); return a; }();
+}
+
+int c() { 
+  goto A; return ^{ A:return 1;}(); // expected-error {{use of undeclared label 'A'}}
+}