[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / Inputs / templates-top.h
blob207d705432e8ec25dc4bbc6b07abf2f7d64bb0e9
1 template<typename T> class Vector;
3 template<typename T> class List {
4 public:
5 void push_back(T);
7 struct node {};
8 node *head;
9 unsigned size;
12 extern List<double> *instantiateListDoubleDeclaration;
13 extern List<long> *instantiateListLongDeclaration;
15 namespace A {
16 class Y {
17 template <typename T> friend class WhereAmI;
21 template <typename T> class A::WhereAmI {
22 public:
23 static void func() {}
26 template<typename T> struct Outer {
27 struct Inner {};
30 template<bool, bool> struct ExplicitInstantiation {
31 void f() {}
34 template<typename> struct DelayUpdates {};
36 template<typename T> struct OutOfLineInline {
37 void f();
38 void g();
39 void h();
41 template<typename T> inline void OutOfLineInline<T>::f() {}
42 template<typename T> inline void OutOfLineInline<T>::g() {}
43 template<typename T> inline void OutOfLineInline<T>::h() {}
45 namespace EmitDefaultedSpecialMembers {
46 template<typename T> struct SmallVectorImpl {
47 SmallVectorImpl() {}
48 ~SmallVectorImpl() {} // non-trivial dtor
50 template<typename T, unsigned N> struct SmallVector : SmallVectorImpl<T> {
51 // trivial dtor
53 template<unsigned N> struct SmallString : SmallVector<char, N> {
54 // trivial dtor
58 template<typename T> struct WithUndefinedStaticDataMember {
59 static T undefined;
62 template<typename T> struct __attribute__((packed, aligned(2))) WithAttributes {
63 T value;
65 WithAttributes<int> *get_with_attributes();