summaryrefslogtreecommitdiff
path: root/libbindgen/tests
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2016-12-22 12:43:29 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2016-12-23 11:40:38 +0100
commitab1d2122b29054e8682c21255fe25a2948b1ac2c (patch)
treeea0f74e4d3b0a60c4f2324a0efc67b294dc963af /libbindgen/tests
parent44690e3a5c73f9df364d3548bf367a4198953eac (diff)
ir: Be more resistent to failure when parsing enums.
Diffstat (limited to 'libbindgen/tests')
-rw-r--r--libbindgen/tests/expectations/tests/enum_in_template_with_typedef.rs18
-rw-r--r--libbindgen/tests/headers/enum_in_template_with_typedef.hpp16
2 files changed, 34 insertions, 0 deletions
diff --git a/libbindgen/tests/expectations/tests/enum_in_template_with_typedef.rs b/libbindgen/tests/expectations/tests/enum_in_template_with_typedef.rs
new file mode 100644
index 00000000..66a304aa
--- /dev/null
+++ b/libbindgen/tests/expectations/tests/enum_in_template_with_typedef.rs
@@ -0,0 +1,18 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(non_snake_case)]
+
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct std_fbstring_core<Char> {
+ pub _address: u8,
+ pub _phantom_0: ::std::marker::PhantomData<Char>,
+}
+pub type std_fbstring_core_category_type = u8;
+pub const std_fbstring_core_Category_Bar: std_fbstring_core_Category =
+ std_fbstring_core_Category::Foo;
+#[repr(u8)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+pub enum std_fbstring_core_Category { Foo = 0, }
diff --git a/libbindgen/tests/headers/enum_in_template_with_typedef.hpp b/libbindgen/tests/headers/enum_in_template_with_typedef.hpp
new file mode 100644
index 00000000..ac19b781
--- /dev/null
+++ b/libbindgen/tests/headers/enum_in_template_with_typedef.hpp
@@ -0,0 +1,16 @@
+// bindgen-flags: -- -std=c++11
+
+namespace std {
+ template <typename Char> class fbstring_core;
+}
+
+typedef unsigned char uint8_t;
+namespace std {
+ template <typename Char> class fbstring_core {
+ typedef uint8_t category_type;
+ enum Category : category_type {
+ Foo = 1,
+ Bar = 4,
+ };
+ };
+}