Skip to content

Commit 82599c5

Browse files
committed
Target: correct binding variable type (NFC)
The returned type for `GetScratchSwiftASTContext` is `llvm::Optional<SwiftASTContextReader>` which cannot be unwrapped. Use `auto` and a reference binding rather than the copy-constructor and unbound type. This repairs the build with MSVC.
1 parent 805872d commit 82599c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/source/Target/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ llvm::Optional<uint64_t> SwiftLanguageRuntimeImpl::GetMemberVariableOffset(
639639

640640
llvm::Optional<SwiftASTContextReader> scratch_ctx;
641641
if (instance) {
642-
if (SwiftASTContextReader reader = instance->GetScratchSwiftASTContext())
642+
if (const auto& reader = instance->GetScratchSwiftASTContext())
643643
scratch_ctx = reader;
644644
else
645645
return llvm::None;

0 commit comments

Comments
 (0)