xref: /aosp_15_r20/external/clang/test/PCH/Inputs/cxx11-statement-attributes.h (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // To be used with cxx11-statement-attributes.cpp.
2*67e74705SXin Li template<const int N>
f(int n)3*67e74705SXin Li int f(int n) {
4*67e74705SXin Li   switch (n * N) {
5*67e74705SXin Li     case 0:
6*67e74705SXin Li       n += 15;
7*67e74705SXin Li       [[clang::fallthrough]];  // This shouldn't generate a warning.
8*67e74705SXin Li     case 1:
9*67e74705SXin Li       n += 20;
10*67e74705SXin Li     case 2:  // This should generate a warning: "unannotated fallthrough"
11*67e74705SXin Li       n += 35;
12*67e74705SXin Li       break;
13*67e74705SXin Li   }
14*67e74705SXin Li   return n;
15*67e74705SXin Li }
16