[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / instantiate-template-fatal-error.cpp
blob9c8916e77bb0db3a2378f80ff3a31431b58b6024
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
3 #pragma clang diagnostic fatal "-Wall"
4 #pragma clang diagnostic fatal "-Wold-style-cast"
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}}
10 template<class T>
11 struct S1 {
14 template<class T>
15 struct S2 : S1<T> {
16 bool m1(const long long *a, T *b) const { return foo0(a, b); }
19 bool foo1(const long long *a, int *b) {
20 S2<int> s2;
21 return s2.m1(a, b);