Skip to content

Commit e1e9b75

Browse files
committed
work
1 parent 3f30d90 commit e1e9b75

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎cpp2rust/converter/models/converter_refcount.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3376,7 +3376,7 @@ void ConverterRefCount::ConvertCXXRecordMethods(clang::CXXRecordDecl *decl) {
33763376
});
33773377

33783378
auto convert_method = [&](clang::CXXMethodDecl *method) {
3379-
if (IsMethodOnPtr(method)) {
3379+
if (IsMethodOnPtr(method) && !method->getReturnType()->isUndeducedType()) {
33803380
ConvertMethodOnPtrTraitDecl(method);
33813381
ConvertMethodOnPtr(method);
33823382
}

‎tests/unit/class_template_lazy_member.cpp‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,24 @@ template <typename T> struct Box {
2020
T twice() { return val + val; }
2121
};
2222

23+
template <typename T> struct Deduced {
24+
T val;
25+
auto get() { return val; }
26+
auto twice() { return val + val; }
27+
};
28+
2329
int main() {
2430
Box<int> i = {3};
2531
assert(i.twice() == 6);
2632

2733
Box<Point> p = {{4}};
2834
assert(p.get().x == 4);
2935

36+
Deduced<int> d = {5};
37+
assert(d.twice() == 10);
38+
39+
Deduced<Point> dp = {{6}};
40+
assert(dp.get().x == 6);
41+
3042
return 0;
3143
}

0 commit comments

Comments
 (0)