summaryrefslogtreecommitdiff
path: root/tests/headers/constify-module-enums-types.hpp
blob: decf935a0028ae2efb2317816fd98a40bc4f9767 (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
// bindgen-flags: --constified-enum-module ".*"

typedef enum foo {
  THIS,
  SHOULD_BE,
  A_CONSTANT,
  ALSO_THIS = 42,
  AND_ALSO_THIS = 42,
} foo;


typedef enum {
  Variant1, Variant2, Variant3,
} anon_enum;


namespace ns1 {
  typedef enum {
    THIS,
    SHOULD_BE,
    A_CONSTANT,
    ALSO_THIS = 42,
  } foo;
}

namespace ns2 {
  enum class Foo {
    Variant1,
    Variant2,
  };
}

typedef foo foo_alias1;
typedef foo_alias1 foo_alias2;
typedef foo_alias2 foo_alias3;

typedef anon_enum anon_enum_alias1;
typedef anon_enum_alias1 anon_enum_alias2;
typedef anon_enum_alias2 anon_enum_alias3;

typedef struct bar {
  foo member1;
  foo_alias1 member2;
  foo_alias2 member3;
  foo_alias3 member4;
  ns1::foo member5;
  ns2::Foo *member6;
  anon_enum member7;
  anon_enum_alias1 member8;
  anon_enum_alias2 member9;
  anon_enum_alias3 member10;
} bar;

class Baz {
  ns2::Foo member1;
};

namespace one {
  enum class Foo {
    Variant1, Variant2,
  };
}

class Bar {
  one::Foo* baz;
};

foo *func1(foo arg1, foo *arg2, foo **arg3);
foo_alias1 *func2(foo_alias1 arg1, foo_alias1 *arg2, foo_alias1 **arg3);

template <class T>
class Thing {
  T thing;
  T& get_thing();
};

foo func3(Thing<foo> arg1);
foo func4(Thing< Thing<foo> > arg1);