|
@@ -1757,10 +1757,10 @@ RecordLayoutBuilder::ComputeKeyFunction(const CXXRecordDecl *RD) {
|
|
|
if (!RD->isPolymorphic())
|
|
|
return 0;
|
|
|
|
|
|
- // A class inside an anonymous namespace doesn't have a key function. (Or
|
|
|
+ // A class that is not externally visible doesn't have a key function. (Or
|
|
|
// at least, there's no point to assigning a key function to such a class;
|
|
|
// this doesn't affect the ABI.)
|
|
|
- if (RD->isInAnonymousNamespace())
|
|
|
+ if (RD->getLinkage() != ExternalLinkage)
|
|
|
return 0;
|
|
|
|
|
|
// Template instantiations don't have key functions,see Itanium C++ ABI 5.2.6.
|