diff --git a/lib/ClangImporter/SwiftLookupTable.cpp b/lib/ClangImporter/SwiftLookupTable.cpp index 980350dc3d531..950a74be8c1a9 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,