Fix rdar://6251437, references to enum constant decls in a block
don't need a BlockDeclRefExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56766 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/block-misc.c b/test/Sema/block-misc.c
index 92632f3..77de4a6 100644
--- a/test/Sema/block-misc.c
+++ b/test/Sema/block-misc.c
@@ -48,3 +48,17 @@
char *^ y; // expected-error {{block pointer to non-function type is invalid}}
}
+
+
+enum {NSBIRLazilyAllocated = 0};
+
+int test4(int argc) { // rdar://6251437
+ ^{
+ switch (argc) {
+ case NSBIRLazilyAllocated: // is an integer constant expression.
+ default:
+ break;
+ }
+ }();
+ return 0;
+}