blob: 9a16f2b4b402ff08bad2f17866b9f5bfcdb71d46 [file] [log] [blame]
Alexander Kornienko01ecd312014-06-25 08:09:35 +00001// RUN: %clang_cc1 -fsyntax-only -verify -fblocks -std=c++11 -Wimplicit-fallthrough %s
2
3void fallthrough_in_blocks() {
4 void (^block)() = ^{
5 int x = 0;
6 switch (x) {
7 case 0:
8 x++;
9 [[clang::fallthrough]]; // no diagnostics
10 case 1:
11 x++;
12 default: // \
13 expected-warning{{unannotated fall-through between switch labels}} \
14 expected-note{{insert 'break;' to avoid fall-through}}
15 break;
16 }
17 };
18 block();
19}