blob: 8b9feb43d93c1e952fc878421ad076f2b37fc976 [file] [log] [blame]
Alexander Kornienko276fc642014-06-29 22:19:53 +00001// RUN: clang-tidy -checks=-*,google-readability-casting %s -- | FileCheck %s
2
3// CHECK-NOT: warning:
4
5bool g() { return false; }
6
7void 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:
21enum E { E1 = 1 };
22template <E e>
23struct A { static const E ee = e; };
24struct B : public A<E1> {};