You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swift-to-C++: getTypeMetadata inline helpers that refer to C++ type metadata are annotated as used for debug compilations, causing linker errors #69234
ld: Undefined symbols:
type metadata accessor for __C.HelloCxxWorld, referenced from:
swift::TypeMetadataTrait<HelloCxxWorld>::getTypeMetadata() in HelloHello.o
This is caused by how the C++ getTypeMetadata inline function is annotated in the generated header. It uses the SWIFT_INLINE_THUNK annotation which in debug mode in Xcode (when DEBUG is defined as a preprocessor macro/Swift build condition) is forced to be emitted into the object file, even when it's not used. This is wrong, as it's not supposed to be linked in forcefully and should only be needed when it's actually used.
Such functions should be annotated with SWIFT_INLINE_PRIVATE_HELPER instead.