Skip to content

Commit ed3aa90

Browse files
kohanisemilio
authored andcommitted
Fix inline function identification
1 parent c03b376 commit ed3aa90

File tree

4 files changed

+71
-47
lines changed

4 files changed

+71
-47
lines changed

bindgen-tests/tests/expectations/tests/public-dtor.rs

+53-35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/headers/constructor-tp.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Foo {
88
};
99

1010
template<typename T>
11-
inline void
11+
void
1212
Foo<T>::doBaz() {
1313
}
1414

@@ -21,6 +21,5 @@ template<typename T>
2121
Foo<T>::Foo() {
2222
}
2323

24-
inline
2524
Bar::Bar() {
2625
}
+12-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11

2-
32
namespace cv {
4-
class String {
5-
public:
6-
~String();
7-
};
3+
class Foo {
4+
public:
5+
~Foo();
6+
};
87

8+
Foo::~Foo() {}
99

10-
inline
11-
String::~String()
12-
{
13-
}
10+
class Bar {
11+
public:
12+
~Bar();
13+
};
14+
15+
inline
16+
Bar::~Bar() {}
1417

1518
}

bindgen/ir/function.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,11 @@ impl ClangSubItemParser for Function {
675675
return Err(ParseError::Continue);
676676
}
677677

678-
if cursor.is_inlined_function() {
678+
if cursor.is_inlined_function() ||
679+
cursor
680+
.definition()
681+
.map_or(false, |x| x.is_inlined_function())
682+
{
679683
if !context.options().generate_inline_functions {
680684
return Err(ParseError::Continue);
681685
}

0 commit comments

Comments
 (0)