| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s |
| 2 |
|
| 3 |
#pragma clang diagnostic fatal "-Wall" |
| 4 |
#pragma clang diagnostic fatal "-Wold-style-cast" |
| 5 |
|
| 6 |
template <class T> bool foo0(const long long *a, T* b) { |
| 7 |
return a == (const long long*)b; // expected-error {{use of old-style cast}} |
| 8 |
} |
| 9 |
|
| 10 |
template<class T> |
| 11 |
struct S1 { |
| 12 |
}; |
| 13 |
|
| 14 |
template<class T> |
| 15 |
struct S2 : S1<T> { |
| 16 |
bool m1(const long long *a, T *b) const { return foo0(a, b); } |
| 17 |
}; |
| 18 |
|
| 19 |
bool foo1(const long long *a, int *b) { |
| 20 |
S2<int> s2; |
| 21 |
return s2.m1(a, b); |
| 22 |
} |