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