summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2016-12-15 16:57:32 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2016-12-15 16:57:32 +0100
commit31bd2d3a1ffa47e15b0701761966fc836c9da99d (patch)
tree7a53b093e80237a38e378b6d6d9d6b7105dcd645
parent0ec5a6aa25bda273781a6569107b82c65cf004c3 (diff)
ir: Don't parse standalone destructors.
-rw-r--r--libbindgen/src/ir/function.rs2
-rw-r--r--libbindgen/tests/expectations/tests/public-dtor.rs16
-rw-r--r--libbindgen/tests/headers/public-dtor.hpp15
3 files changed, 32 insertions, 1 deletions
diff --git a/libbindgen/src/ir/function.rs b/libbindgen/src/ir/function.rs
index a068097d..76576dbd 100644
--- a/libbindgen/src/ir/function.rs
+++ b/libbindgen/src/ir/function.rs
@@ -242,9 +242,9 @@ impl ClangSubItemParser for Function {
-> Result<ParseResult<Self>, ParseError> {
use clang_sys::*;
match cursor.kind() {
+ // FIXME(emilio): Generate destructors properly.
CXCursor_FunctionDecl |
CXCursor_Constructor |
- CXCursor_Destructor |
CXCursor_CXXMethod => {}
_ => return Err(ParseError::Continue),
};
diff --git a/libbindgen/tests/expectations/tests/public-dtor.rs b/libbindgen/tests/expectations/tests/public-dtor.rs
new file mode 100644
index 00000000..851857ee
--- /dev/null
+++ b/libbindgen/tests/expectations/tests/public-dtor.rs
@@ -0,0 +1,16 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(non_snake_case)]
+
+
+#[repr(C)]
+#[derive(Debug)]
+pub struct cv_String {
+ pub _address: u8,
+}
+#[test]
+fn bindgen_test_layout_cv_String() {
+ assert_eq!(::std::mem::size_of::<cv_String>() , 1usize);
+ assert_eq!(::std::mem::align_of::<cv_String>() , 1usize);
+}
diff --git a/libbindgen/tests/headers/public-dtor.hpp b/libbindgen/tests/headers/public-dtor.hpp
new file mode 100644
index 00000000..5d4fb592
--- /dev/null
+++ b/libbindgen/tests/headers/public-dtor.hpp
@@ -0,0 +1,15 @@
+
+
+namespace cv {
+class String {
+public:
+ ~String();
+};
+
+
+inline
+String::~String()
+{
+}
+
+}