reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
// RUN: %clang_cc1 -fsyntax-only -verify -fblocks -std=c++11 -Wimplicit-fallthrough %s

void fallthrough_in_blocks() {
  void (^block)() = ^{
    int x = 0;
    switch (x) {
    case 0:
      x++;
      [[clang::fallthrough]]; // no diagnostics
    case 1:
      x++;
    default: // \
        expected-warning{{unannotated fall-through between switch labels}} \
        expected-note{{insert 'break;' to avoid fall-through}}
      break;
    }
  };
  block();
}