From aeebef939613fe8cf664fcd76a5044de53d8e3e8 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Thu, 1 Dec 2022 15:46:33 +0000 Subject: [PATCH] [cxx-interop][rebranch] Handle clang elaborated types, part 2 This applies the same trick as https://github.com/apple/swift/pull/62190 for newly written code. Fixes two C++ interop tests in rebranch: * `Interop/Cxx/enum/c-enums-NS_OPTIONS-api-notes-renamed-options.swift` * `Interop/Cxx/enum/c-enums-NS_OPTIONS-swift-named-options.swift` rdar://102858524 --- lib/ClangImporter/SwiftLookupTable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ClangImporter/SwiftLookupTable.cpp b/lib/ClangImporter/SwiftLookupTable.cpp index 980350dc3d53..950a74be8c1a 100644 --- a/lib/ClangImporter/SwiftLookupTable.cpp +++ b/lib/ClangImporter/SwiftLookupTable.cpp @@ -213,8 +213,8 @@ translateDeclToContext(clang::NamedDecl *decl) { return std::make_pair(SwiftLookupTable::ContextKind::Tag, typedefDecl->getName()); if (auto enumDecl = dyn_cast(tag)) { - if (auto typedefType = dyn_cast( - enumDecl->getIntegerType().getTypePtr())) { + if (auto typedefType = + dyn_cast(getUnderlyingType(enumDecl))) { if (importer::isUnavailableInSwift(typedefType->getDecl(), nullptr, true)) { return std::make_pair(SwiftLookupTable::ContextKind::Tag,