Skip to content

Commit ce0a254

Browse files
committed
ir: Do the proper thing for methods.
1 parent 1129431 commit ce0a254

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

libbindgen/src/ir/function.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ impl FunctionSig {
187187

188188
let is_method = cursor.kind() == CXCursor_CXXMethod;
189189
let is_constructor = cursor.kind() == CXCursor_Constructor;
190-
if is_constructor && cursor.lexical_parent() != cursor.semantic_parent() {
190+
if (is_constructor || is_method) &&
191+
cursor.lexical_parent() != cursor.semantic_parent() {
191192
// Only parse constructors once.
192193
return Err(ParseError::Continue);
193194
}

libbindgen/tests/headers/constructor-tp.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@ template<typename T>
33
class Foo {
44
public:
55
Foo();
6+
7+
void doBaz();
68
};
79

10+
template<typename T>
11+
inline void
12+
Foo<T>::doBaz() {
13+
}
14+
815
class Bar {
916
public:
1017
Bar();

0 commit comments

Comments
 (0)