diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2016-12-15 18:09:00 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2016-12-15 18:09:00 +0100 |
commit | ce0a254131be56e3c437199c21f48a2d5428c91d (patch) | |
tree | c31d58253ef78e7631e15caf7aa007dc41d6ab03 | |
parent | 1129431b00cb3ab76dce0ab8b2956d319d939f3a (diff) |
ir: Do the proper thing for methods.
-rw-r--r-- | libbindgen/src/ir/function.rs | 3 | ||||
-rw-r--r-- | libbindgen/tests/headers/constructor-tp.hpp | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/libbindgen/src/ir/function.rs b/libbindgen/src/ir/function.rs index 1b930ac3..516c486e 100644 --- a/libbindgen/src/ir/function.rs +++ b/libbindgen/src/ir/function.rs @@ -187,7 +187,8 @@ impl FunctionSig { let is_method = cursor.kind() == CXCursor_CXXMethod; let is_constructor = cursor.kind() == CXCursor_Constructor; - if is_constructor && cursor.lexical_parent() != cursor.semantic_parent() { + if (is_constructor || is_method) && + cursor.lexical_parent() != cursor.semantic_parent() { // Only parse constructors once. return Err(ParseError::Continue); } diff --git a/libbindgen/tests/headers/constructor-tp.hpp b/libbindgen/tests/headers/constructor-tp.hpp index 7a420413..6e55ea78 100644 --- a/libbindgen/tests/headers/constructor-tp.hpp +++ b/libbindgen/tests/headers/constructor-tp.hpp @@ -3,8 +3,15 @@ template<typename T> class Foo { public: Foo(); + + void doBaz(); }; +template<typename T> +inline void +Foo<T>::doBaz() { +} + class Bar { public: Bar(); |