[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / Inputs / stress1 / common.h
blobb52520ee8f559797badee4d5fe88a82b61630d1d
1 #ifndef STRESS1_COMMON_H
2 #define STRESS1_COMMON_H
4 inline char function00(char x) { return x + x; }
5 inline short function00(short x) { return x + x; }
6 inline int function00(int x) { return x + x; }
8 namespace N01 { struct S00; }
10 namespace N00 {
11 struct S00 {
12 char c;
13 short s;
14 int i;
16 S00(char x) : c(x) {}
17 S00(short x) : s(x) {}
18 S00(int x) : i(x) {}
20 char method00(char x) { return x + x; }
21 short method00(short x) { return x + x; }
22 int method00(int x) { return x + x; }
24 operator char() { return c; }
25 operator short() { return s; }
26 operator int() { return i; }
28 struct S01 {};
29 struct S02 {};
30 template <typename T> struct S03 {
31 struct S00 : N00::S00 {};
33 template <int I, template <typename> class U> struct S03<U<int>[I]>
34 : U<int>::S00 {
35 S03();
36 S03(int);
37 S03(short);
38 S03(char);
39 template <typename V = decltype(I)> S03(V);
41 template <> struct S03<S03<int>[42]> : S00 {};
44 namespace N01 {
45 struct S00 : N00::S00 {
46 using N00::S00::S00;
48 struct S01 {};
49 struct S02 {};
52 using namespace N00;
54 template <int I, template <typename> class U> template <typename V> S03<U<int>[I]>::S03(V x) : S00(x) {}
55 template <int I, template <typename> class U> S03<U<int>[I]>::S03() : S00(I) {}
56 template <int I, template <typename> class U> S03<U<int>[I]>::S03(char x) : S00(x) {}
57 template <int I, template <typename> class U> S03<U<int>[I]>::S03(short x) : S00(x) {}
58 template <int I, template <typename> class U> S03<U<int>[I]>::S03(int x) : S00(x) {}
60 #pragma weak pragma_weak00
61 #pragma weak pragma_weak01
62 #pragma weak pragma_weak02
63 #pragma weak pragma_weak03
64 #pragma weak pragma_weak04
65 #pragma weak pragma_weak05
67 extern "C" int pragma_weak00();
68 extern "C" int pragma_weak01();
69 extern "C" int pragma_weak02();
70 extern "C" int pragma_weak03;
71 extern "C" int pragma_weak04;
72 extern "C" int pragma_weak05;
74 #endif