Clang Project

clang_source_code/test/Modules/Inputs/stress1/common.h
1#ifndef STRESS1_COMMON_H
2#define STRESS1_COMMON_H
3
4inline char function00(char x) { return x + x; }
5inline short function00(short x) { return x + x; }
6inline int function00(int x) { return x + x; }
7
8namespace N01 { struct S00; }
9
10namespace N00 {
11struct S00 {
12  char c;
13  short s;
14  int i;
15
16  S00(char x) : c(x) {}
17  S00(short x) : s(x) {}
18  S00(int x) : i(x) {}
19
20  char method00(char x) { return x + x; }
21  short method00(short x) { return x + x; }
22  int method00(int x) { return x + x; }
23
24  operator char() { return c; }
25  operator short() { return s; }
26  operator int() { return i; }
27};
28struct S01 {};
29struct S02 {};
30template <typename T> struct S03 {
31  struct S00 : N00::S00 {};
32};
33template <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);
40};
41template <> struct S03<S03<int>[42]> : S00 {};
42}
43
44namespace N01 {
45struct S00 : N00::S00 {
46  using N00::S00::S00;
47};
48struct S01 {};
49struct S02 {};
50}
51
52using namespace N00;
53
54template <int I, template <typename> class U> template <typename V> S03<U<int>[I]>::S03(V x) : S00(x) {}
55template <int I, template <typename> class U> S03<U<int>[I]>::S03() : S00(I) {}
56template <int I, template <typename> class U> S03<U<int>[I]>::S03(char x) : S00(x) {}
57template <int I, template <typename> class U> S03<U<int>[I]>::S03(short x) : S00(x) {}
58template <int I, template <typename> class U> S03<U<int>[I]>::S03(int x) : S00(x) {}
59
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
66
67extern "C" int pragma_weak00();
68extern "C" int pragma_weak01();
69extern "C" int pragma_weak02();
70extern "C" int pragma_weak03;
71extern "C" int pragma_weak04;
72extern "C" int pragma_weak05;
73
74#endif
75