brintos

brintos / llvm-project-archived public Read only

0
0
Text · 463 B · 9a16f2b Raw
20 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -fblocks -std=c++11 -Wimplicit-fallthrough %s2 3void fallthrough_in_blocks() {4  void (^block)() = ^{5    int x = 0;6    switch (x) {7    case 0:8      x++;9      [[clang::fallthrough]]; // no diagnostics10    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}20