~shimon/dismaltc

ref: 461e0617cb03f1d5027af4fbb3da0722791022e9 dismaltc/clang/disable-test/PCH/Inputs/cxx11-statement-attributes.h -rw-r--r-- 350 bytes
461e0617Itoh Shimon re-enable tests. 1 year, 2 months ago
                                                                                
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;
}