Files
codeql/cpp/ql/test/library-tests/attributes/stmt_attributes/clang_fallthrough.cpp
2018-08-02 17:53:23 +01:00

46 lines
438 B
C++

void test(int x) {
int y = 0;
switch (x)
{
case 1:
break;
case 2:
case 3:
[[clang::fallthrough]];
case 4:
y++;
break;
case 5:
y++;
case 6:
y++;
[[clang::fallthrough]];
case 7:
[[clang::fallthrough]];
y++;
case 8:
{
y++;
} break;
case 9:
{
y++;
}
case 10:
{
y++;
[[clang::fallthrough]];
}
case 11:
{
y++;
} [[clang::fallthrough]];
default:
[[clang::fallthrough]];
}
}