xref: /minix3/external/bsd/llvm/dist/clang/test/PCH/Inputs/cxx11-statement-attributes.h (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1 // To be used with cxx11-statement-attributes.cpp.
2 template<const int N>
f(int n)3 int f(int n) {
4   switch (n * N) {
5     case 0:
6       n += 15;
7       [[clang::fallthrough]];  // This shouldn't generate a warning.
8     case 1:
9       n += 20;
10       [[clang::fallthrough]];  // This should generate a warning: "fallthrough annotation does not directly precede switch label".
11       break;
12   }
13   return n;
14 }
15