Alexander Kornienko | 276fc64 | 2014-06-29 22:19:53 +0000 | [diff] [blame] | 1 | // RUN: clang-tidy -checks=-*,google-readability-casting %s -- | FileCheck %s |
| 2 | |
| 3 | // CHECK-NOT: warning: |
| 4 | |
| 5 | bool g() { return false; } |
| 6 | |
| 7 | void f(int a, double b) { |
| 8 | int b1 = (int)b; |
| 9 | // CHECK: :[[@LINE-1]]:12: warning: C-style casts are discouraged. Use static_cast{{.*}} |
| 10 | |
| 11 | // CHECK-NOT: warning: |
| 12 | int b2 = int(b); |
| 13 | int b3 = static_cast<double>(b); |
| 14 | int b4 = b; |
| 15 | double aa = a; |
| 16 | (void)b2; |
| 17 | return (void)g(); |
| 18 | } |
| 19 | |
| 20 | // CHECK-NOT: warning: |
| 21 | enum E { E1 = 1 }; |
| 22 | template <E e> |
| 23 | struct A { static const E ee = e; }; |
| 24 | struct B : public A<E1> {}; |