1 | template <typename T> struct S { |
2 | typedef T V; |
3 | |
4 | V value; |
5 | }; |
6 | |
7 | typedef S<float> GlobalTypedef; |
8 | |
9 | namespace ns { |
10 | typedef S<float> NamespaceTypedef; |
11 | } |
12 | |
13 | struct 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. |
20 | struct NonLocalVarStruct { |
21 | typedef int OtherStructTypedef; |
22 | }; |
23 | |
24 | int otherFunc() { |
25 | NonLocalVarStruct::OtherStructTypedef i = 3; |
26 | return i; |
27 | } |
28 | |
29 | int 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 | |