Skip to content

Commit c6421d3

Browse files
committed
Print lambda in GetNamedDeclAsString
1 parent 637eb94 commit c6421d3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎cpp2rust/converter/converter_lib.cpp‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,9 +1000,11 @@ std::string GetNamedDeclAsString(const clang::NamedDecl *decl) {
10001000
target = record;
10011001
}
10021002
}
1003+
auto *record = clang::dyn_cast<clang::CXXRecordDecl>(target);
10031004
return std::format(
1004-
"anon_{}", type_mapping.try_emplace(GetID(target), type_mapping.size())
1005-
.first->second);
1005+
"{}_{}", record && record->isLambda() ? "lambda" : "anon",
1006+
type_mapping.try_emplace(GetID(target), type_mapping.size())
1007+
.first->second);
10061008
}
10071009

10081010
std::optional<size_t> id;

0 commit comments

Comments
 (0)