summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/expectations/tests/dupe-enum-variant-in-namespace.rs30
-rw-r--r--tests/headers/dupe-enum-variant-in-namespace.h10
2 files changed, 40 insertions, 0 deletions
diff --git a/tests/expectations/tests/dupe-enum-variant-in-namespace.rs b/tests/expectations/tests/dupe-enum-variant-in-namespace.rs
new file mode 100644
index 00000000..b93100b2
--- /dev/null
+++ b/tests/expectations/tests/dupe-enum-variant-in-namespace.rs
@@ -0,0 +1,30 @@
+/* automatically generated by rust-bindgen */
+
+#![allow(
+ dead_code,
+ non_snake_case,
+ non_camel_case_types,
+ non_upper_case_globals
+)]
+
+#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
+pub mod root {
+ #[allow(unused_imports)]
+ use self::super::root;
+ pub mod foo {
+ #[allow(unused_imports)]
+ use self::super::super::root;
+ impl root::foo::Bar {
+ pub const Foo1: root::foo::Bar = Bar::Foo;
+ }
+ impl root::foo::Bar {
+ pub const Foo3: root::foo::Bar = Bar::Foo2;
+ }
+ #[repr(u32)]
+ #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+ pub enum Bar {
+ Foo = 0,
+ Foo2 = 1,
+ }
+ }
+}
diff --git a/tests/headers/dupe-enum-variant-in-namespace.h b/tests/headers/dupe-enum-variant-in-namespace.h
new file mode 100644
index 00000000..6d72437d
--- /dev/null
+++ b/tests/headers/dupe-enum-variant-in-namespace.h
@@ -0,0 +1,10 @@
+// bindgen-flags: --rustified-enum ".*" --enable-cxx-namespaces -- -x c++
+
+namespace foo {
+ enum class Bar : unsigned {
+ Foo = 0,
+ Foo1 = 0,
+ Foo2,
+ Foo3 = Foo2,
+ };
+}