summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH/Inputs/cxx11-statement-attributes.h
blob: 3f85e1fa2b0621f598e9fcd8ba887b0eb0d60be2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// To be used with cxx11-statement-attributes.cpp.
template<const int N>
int f(int n) {
  switch (n * N) {
    case 0:
      n += 15;
      [[clang::fallthrough]];  // This shouldn't generate a warning.
    case 1:
      n += 20;
    case 2:  // This should generate a warning: "unannotated fallthrough"
      n += 35;
      break;
  }
  return n;
}
OpenPOWER on IntegriCloud