Skip to content

Commit

Permalink
Fix inline function identification
Browse files Browse the repository at this point in the history
  • Loading branch information
kohanis authored and emilio committed Nov 9, 2022
1 parent c03b376 commit ed3aa90
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 47 deletions.
88 changes: 53 additions & 35 deletions bindgen-tests/tests/expectations/tests/public-dtor.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions bindgen-tests/tests/headers/constructor-tp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Foo {
};

template<typename T>
inline void
void
Foo<T>::doBaz() {
}

Expand All @@ -21,6 +21,5 @@ template<typename T>
Foo<T>::Foo() {
}

inline
Bar::Bar() {
}
21 changes: 12 additions & 9 deletions bindgen-tests/tests/headers/public-dtor.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@


namespace cv {
class String {
public:
~String();
};
class Foo {
public:
~Foo();
};

Foo::~Foo() {}

inline
String::~String()
{
}
class Bar {
public:
~Bar();
};

inline
Bar::~Bar() {}

}
6 changes: 5 additions & 1 deletion bindgen/ir/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,11 @@ impl ClangSubItemParser for Function {
return Err(ParseError::Continue);
}

if cursor.is_inlined_function() {
if cursor.is_inlined_function() ||
cursor
.definition()
.map_or(false, |x| x.is_inlined_function())
{
if !context.options().generate_inline_functions {
return Err(ParseError::Continue);
}
Expand Down

0 comments on commit ed3aa90

Please sign in to comment.