Index: clang/lib/CodeGen/TargetInfo.cpp =================================================================== --- clang/lib/CodeGen/TargetInfo.cpp +++ clang/lib/CodeGen/TargetInfo.cpp @@ -10979,6 +10979,15 @@ // Unions aren't eligible unless they're empty (which is caught above). if (RD->isUnion()) return false; + // If this is a C++ record, check the bases first. + if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) { + for (const CXXBaseSpecifier &B : CXXRD->bases()) { + bool Ret = detectFPCCEligibleStructHelper( + B.getType(), CurOff, Field1Ty, Field1Off, Field2Ty, Field2Off); + if (!Ret) + return false; + } + } int ZeroWidthBitFieldCount = 0; for (const FieldDecl *FD : RD->fields()) { const ASTRecordLayout &Layout = getContext().getASTRecordLayout(RD);