From f20a6bc5ff5a7b47532fcd750a143d25adcaafe5 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 3 Oct 2025 10:58:34 +0100 Subject: [PATCH] Fix 2 leftover rebranch warnings ``` lib/Index/Index.cpp:137:41: warning: returning address of local temporary object [-Wreturn-stack-address] lib/Sema/ImportResolution.cpp:627:9: warning: 'AttributedImport' may not intend to support class template argument deduction [-Wctad-maybe-unsupported] ``` --- lib/Index/Index.cpp | 8 ++++++-- lib/Sema/ImportResolution.cpp | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Index/Index.cpp b/lib/Index/Index.cpp index 8b10c193cec34..d8a62e3257cfa 100644 --- a/lib/Index/Index.cpp +++ b/lib/Index/Index.cpp @@ -134,8 +134,12 @@ class SourceFileOrModule { } ArrayRef getFiles() const { - return isa(SFOrMod) ? *SFOrMod.getAddrOfPtr1() - : cast(SFOrMod)->getFiles(); + if (isa(SFOrMod)) { + SourceFile *const *SF = SFOrMod.getAddrOfPtr1(); + return ArrayRef((FileUnit *const *)SF, 1); + } else { + return cast(SFOrMod)->getFiles(); + } } StringRef getFilename() const { diff --git a/lib/Sema/ImportResolution.cpp b/lib/Sema/ImportResolution.cpp index f0773077dd551..3c4f4325f4674 100644 --- a/lib/Sema/ImportResolution.cpp +++ b/lib/Sema/ImportResolution.cpp @@ -623,8 +623,7 @@ void ImportResolver::addImplicitImports() { const ModuleDecl *moduleToInherit = nullptr; if (underlyingClangModule) { moduleToInherit = underlyingClangModule; - boundImports.push_back( - AttributedImport(ImportedModule(underlyingClangModule))); + boundImports.emplace_back(ImportedModule(underlyingClangModule)); } else { moduleToInherit = SF.getParentModule(); }