diff --git a/lldb/source/Plugins/TypeSystem/Swift/CMakeLists.txt b/lldb/source/Plugins/TypeSystem/Swift/CMakeLists.txt index 30eab8a6e9c5a..c7829de818254 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/CMakeLists.txt +++ b/lldb/source/Plugins/TypeSystem/Swift/CMakeLists.txt @@ -13,3 +13,9 @@ add_lldb_library(lldbPluginTypeSystemSwift PLUGIN LINK_COMPONENTS Support ) + +# Enforce synchronization between Swift compiler updates and LLDB via PR testing. +check_cxx_compiler_flag("-Werror=switch" CXX_SUPPORTS_ERROR_SWITCH) +if (CXX_SUPPORTS_ERROR_SWITCH) + target_compile_options(lldbPluginTypeSystemSwift PRIVATE -Werror=switch) +endif() diff --git a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp index 8c40aaea4c3fd..86e57baa63a47 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp +++ b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp @@ -4851,6 +4851,7 @@ static SwiftASTContext::TypeOrDecl DeclToTypeOrDecl(swift::Decl *decl) { case swift::DeclKind::Module: case swift::DeclKind::Missing: case swift::DeclKind::MissingMember: + case swift::DeclKind::Using: break; case swift::DeclKind::InfixOperator: