Skip to content

Commit 406c47e

Browse files
Copilotnunoplopes
andauthored
Fix typo, idiomatic empty check, and missing nullptr arg in converter_lib.cpp
Agent-Logs-Url: https://github.com/Cpp2Rust/cpp2rust/sessions/b040cd89-3c59-4900-bde6-77258f6721f9 Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
1 parent fd4dc78 commit 406c47e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cpp2rust/converter/converter_lib.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ GetUserDefinedDefaultConstructor(const clang::CXXRecordDecl *decl) {
274274

275275
std::string GetMainFileName(const clang::ASTContext &ctx) {
276276
const auto &src_mgr = ctx.getSourceManager();
277-
auto filed_id = src_mgr.getMainFileID();
278-
auto file_entry = src_mgr.getFileEntryRefForID(filed_id);
277+
auto file_id = src_mgr.getMainFileID();
278+
auto file_entry = src_mgr.getFileEntryRefForID(file_id);
279279
auto file_path = file_entry->getName();
280280
auto file_name = llvm::sys::path::filename(file_path);
281281
return llvm::sys::path::stem(file_name).str();
@@ -399,7 +399,7 @@ std::string GetNamedDeclAsString(const clang::NamedDecl *decl) {
399399
}
400400
}
401401

402-
if (name.size() == 0) {
402+
if (name.empty()) {
403403
name = "self";
404404
}
405405

@@ -539,7 +539,7 @@ GetTemplateArgs(clang::QualType qual_type, clang::Expr *expr) {
539539
if (auto pt = qual_type->getPointeeType(); !pt.isNull())
540540
qual_type = pt;
541541

542-
return GetTemplateArgs(qual_type);
542+
return GetTemplateArgs(qual_type, nullptr);
543543
}
544544

545545
clang::Expr *GetCallObject(clang::CallExpr *expr) {

0 commit comments

Comments
 (0)