summaryrefslogtreecommitdiff
path: root/tests/headers/constify-module-enums-types.hpp
diff options
context:
space:
mode:
authorTravis Finkenauer <tmfinken@gmail.com>2017-06-18 19:56:25 -0700
committerTravis Finkenauer <tmfinken@gmail.com>2017-06-18 19:56:25 -0700
commit4b10529701f89cc523c932bfe1a160864b3061ae (patch)
tree9674d5af5a8a37b8f54410f009f8d8d03e786998 /tests/headers/constify-module-enums-types.hpp
parent5f4b73051ab7895e085e4a8e57fc87e7df0120f7 (diff)
Fix recursive aliases to const module enum
Item::is_constified_enum_module() only returns true for the base type, not for "layers" of aliases. Added a "simple alias" test and added content to the types test.
Diffstat (limited to 'tests/headers/constify-module-enums-types.hpp')
-rw-r--r--tests/headers/constify-module-enums-types.hpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/tests/headers/constify-module-enums-types.hpp b/tests/headers/constify-module-enums-types.hpp
index b49dc038..1618b269 100644
--- a/tests/headers/constify-module-enums-types.hpp
+++ b/tests/headers/constify-module-enums-types.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --constified-enum-module foo
+// bindgen-flags: --constified-enum-module .*
typedef enum foo {
THIS,
@@ -9,7 +9,7 @@ typedef enum foo {
} foo;
namespace ns1 {
- typedef enum foo2 {
+ typedef enum {
THIS,
SHOULD_BE,
A_CONSTANT,
@@ -17,16 +17,40 @@ namespace ns1 {
} foo;
}
+namespace ns2 {
+ enum class Foo {
+ Variant1,
+ Variant2,
+ };
+}
+
typedef foo foo_alias1;
typedef foo_alias1 foo_alias2;
+typedef foo_alias2 foo_alias3;
typedef struct bar {
foo member1;
foo_alias1 member2;
foo_alias2 member3;
- ns1::foo member4;
+ foo_alias3 member4;
+ ns1::foo member5;
+ ns2::Foo *member6;
} 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);
@@ -36,4 +60,5 @@ class Thing {
T& get_thing();
};
-foo func3(Thing<foo> arg1); \ No newline at end of file
+foo func3(Thing<foo> arg1);
+foo func4(Thing< Thing<foo> > arg1); \ No newline at end of file