Skip to content

Commit cc5788d

Browse files
committed
Add conevrsion operators under constructors
1 parent c6806bd commit cc5788d

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎cpp2rust/converter/rules/rule_keys.cpp‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ std::optional<ExprKey> getConstructorKey(const clang::Decl *parent) {
9898
return Constructor{parent};
9999
}
100100

101-
ExprKey getMemberKey(const clang::Decl *parent, clang::DeclarationName name) {
101+
std::optional<ExprKey> getMemberKey(const clang::Decl *parent,
102+
clang::DeclarationName name) {
103+
if (name.getNameKind() == clang::DeclarationName::CXXConversionFunctionName) {
104+
return getConstructorKey(parent);
105+
}
102106
if (!parent) {
103107
return Unqualified{name};
104108
}

‎cpp2rust/converter/rules/rule_keys.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct Member {
2222
bool operator==(const Member &) const = default;
2323
};
2424

25+
// Constructors and conversion operators.
2526
struct Constructor {
2627
const clang::Decl *parent;
2728

0 commit comments

Comments
 (0)