You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
463 B
20 lines
463 B
// 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();
|
|
}
|