1template <typename T> struct S {
2 typedef T V;
3
4 V value;
5};
6
7typedef S<float> GlobalTypedef;
8
9namespace ns {
10typedef S<float> NamespaceTypedef;
11}
12
13struct ST {
14 typedef S<float> StructTypedef;
15};
16
17// Struct type that is not supposed to be a local variable in the test
18// expression evaluation scope. Tests that typedef lookup can actually look
19// inside class/struct scopes.
20struct NonLocalVarStruct {
21 typedef int OtherStructTypedef;
22};
23
24int otherFunc() {
25 NonLocalVarStruct::OtherStructTypedef i = 3;
26 return i;
27}
28
29int main(int argc, char const *argv[]) {
30 GlobalTypedef s{.value: .5};
31 ns::NamespaceTypedef in_ns;
32 ST::StructTypedef in_struct;
33 return otherFunc(); // Set a breakpoint here
34}
35

source code of lldb/test/API/lang/cpp/typedef/main.cpp