xref: /llvm-project/lldb/test/API/lang/cpp/function-local-class/main.cpp (revision cda1450f1c771712718ef3585315f0ecbb708d8d)
1 // These declarations have intentionally the same name as the function-local
2 // class. LLDB should never pull in these definitions as this test only inspects
3 // the classes defined in the function below.
4 struct WithMember {
5   float false_def;
6 };
7 typedef struct {
8   float false_def;
9 } TypedefUnnamed;
10 struct ForwardConflict {
11   float false_def;
12 };
13 ForwardConflict conflict1;
14 WithMember conflict2;
15 struct {
16   float false_def;
17 } unnamed;
18 
main()19 int main() {
20   struct WithMember {
21     int i;
22   };
23   typedef struct {
24     int a;
25   } TypedefUnnamed;
26   typedef struct {
27     int b;
28   } TypedefUnnamed2;
29   struct Forward;
30   struct ForwardConflict;
31 
32   WithMember m = {1};
33   TypedefUnnamed typedef_unnamed = {2};
34   TypedefUnnamed2 typedef_unnamed2 = {3};
35   struct {
36     int i;
37   } unnamed = {4};
38   struct {
39     int j;
40   } unnamed2 = {5};
41   Forward *fwd = nullptr;
42   ForwardConflict *fwd_conflict = nullptr;
43   return 0; // break here
44 }
45