[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / switch-implicit-fallthrough-blocks.cpp
blob9a16f2b4b402ff08bad2f17866b9f5bfcdb71d46
1 // RUN: %clang_cc1 -fsyntax-only -verify -fblocks -std=c++11 -Wimplicit-fallthrough %s
3 void 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;
18 block();