summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2017-02-07 15:02:56 -0800
committerNick Fitzgerald <fitzgen@gmail.com>2017-02-08 10:08:36 -0800
commitde35b8a4c510722480c7af2e02f4322aad45ec55 (patch)
tree5498f8e0167820e4dce661fd799c65fa45a7df5d
parent4348fb0c4c7e558705d573bf11d3d8262ccf39fc (diff)
Add a test case for issue #446
-rw-r--r--tests/expectations/tests/issue-446.rs22
-rw-r--r--tests/headers/issue-446.hpp11
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/expectations/tests/issue-446.rs b/tests/expectations/tests/issue-446.rs
new file mode 100644
index 00000000..fa736bcc
--- /dev/null
+++ b/tests/expectations/tests/issue-446.rs
@@ -0,0 +1,22 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(non_snake_case)]
+
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct List<Elem> {
+ pub next: *mut List<Elem>,
+}
+impl <Elem> Default for List<Elem> {
+ fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct PersistentRooted<GcThing> {
+ pub root_list: List<PersistentRooted<GcThing>>,
+}
+impl <GcThing> Default for PersistentRooted<GcThing> {
+ fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+}
diff --git a/tests/headers/issue-446.hpp b/tests/headers/issue-446.hpp
new file mode 100644
index 00000000..2e09c274
--- /dev/null
+++ b/tests/headers/issue-446.hpp
@@ -0,0 +1,11 @@
+// bindgen-flags: -- -std=c++14
+
+template <typename Elem>
+class List {
+ List<Elem> *next;
+};
+
+template <typename GcThing>
+class PersistentRooted {
+ List<PersistentRooted<GcThing>> root_list;
+};