aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/unittest/data/tooltipinfo.cpp
blob: 6844a823cc55f9c991821a29cd3a5eb0da593a9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
void f(int foo, const int *cfoo)
{
    foo++;
    cfoo++;
}



struct Foo { int member = 0; };
int g(const Foo &foo)
{
    return foo.member;
    const Foo bar;
    bar;
}

struct Bar { virtual ~Bar(); int mem(){} virtual int virtualConstMem() const; };
void h(const Foo &foo, Bar &bar)
{
    g(foo);
    bar.mem();
    bar.virtualConstMem();
}


template <typename T>
void t(int foo) { (void)foo; }
void c()
{
    t<Foo>(3);
}



/**
 * \brief This is a crazy function.
 */
void documentedFunction();
void d()
{
    documentedFunction();
}



enum EnumType { V1, V2, Custom = V2 + 5 };
EnumType e()
{
    return EnumType::Custom;
}



template <typename T> struct Baz { T member; };
void t2(const Baz<int> &b) {
    Baz<int> baz; baz = b;
}

#include "tooltipinfo.h"



#define MACRO_FROM_MAINFILE(x) x + 3
void foo()
{
    MACRO_FROM_MAINFILE(7);
    MACRO_FROM_HEADER(7);
}



namespace N { struct Muu{}; }
namespace G = N;
void o()
{
    using namespace N;
    Muu muu; (void)muu;
}
void n()
{
    using namespace G;
    Muu muu; (void)muu;
}
void q()
{
    using N::Muu;
    Muu muu; (void)muu;
}



struct Sizes
{
    char memberChar1;
    char memberChar2;
};
enum class FancyEnumType { V1, V2 };
union Union
{
    char memberChar1;
    char memberChar2;
};



namespace X {
namespace Y {
}
}



template<typename T> struct Ptr {};
struct Nuu {};

typedef Ptr<Nuu> PtrFromTypeDef;
using PtrFromTypeAlias = Ptr<Nuu>;
template<typename T> using PtrFromTemplateTypeAlias = Ptr<T>;

void y()
{
    PtrFromTypeDef b; (void)b;
    PtrFromTypeAlias a; (void)a;
    PtrFromTemplateTypeAlias<Nuu> c; (void)c;
}



template <typename T> struct Zii {};
namespace U { template <typename T> struct Yii {}; }
void mc()
{
    using namespace U;
    Zii<int> zii; (void) zii;
    Yii<int> yii; (void) yii;
}



namespace A { struct X {}; }
namespace B = A;
void ab()
{
    B::X x; (void)x;
}



namespace N {
struct Outer
{
    template <typename T> struct Inner {};
    Inner<int> inner;
};
}



void f();
namespace R { void f(); }
void f(int param);
void z(int = 1);
void user()
{
    f();
    R::f();
    f(1);
    z();
}




void autoTypes()
{
    auto a = 3; (void)a;
    auto b = EnumType::V1; (void)b;
    auto c = Bar(); (void)c;
    auto d = Zii<int>(); (void)d;
}




struct Con {};
struct ExplicitCon {
    ExplicitCon() = default;
    ExplicitCon(int m) :member(m) {}
    int member;
};
void constructor()
{
    Con();
    ExplicitCon();
    ExplicitCon(2);
}

Nuu **pointers(Nuu **p1)
{
    return p1;
}

static constexpr int calcValue() { return 1 + 2; }
const auto val = calcValue() + sizeof(char);