summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbindgen/src/ir/function.rs3
-rw-r--r--libbindgen/tests/headers/constructor-tp.hpp7
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();