swift
4fd866cc - Correct effective context translation for NS_OPTIONS anon C++ enums

Commit
3 years ago
Correct effective context translation for NS_OPTIONS anon C++ enums Prior to this patch, SwiftLookupTable::translateDeclToContext relied on the `TypedefNameDeclOrQualifier` field of an anonymous tag decl to create a name for entry representing an anonymous tag in the lookup table. This field is not always populated by Clang, it is often populated only for the purposes of generating a linkage name when the type is introduced via typedef as follows: ``` typedef enum { option1, option2} MyAnonEnum; ``` The field is not populated for anonymous enums introduced by NS_OPTIONS with cxx interop enabled. This patch adds a fallback check in `translateDeclToContext` that if the field is empty, check if the enum is backed by a typedef that is unavailable in Swift. If that is the case, use that name for the lookup table entry.
Author
Committer
Parents
Loading