efriedma added a comment. I'm tempted to say this is a bugfix for the implementation of no_unique_address, and just fix it globally for all ABIs. We're never going to get anything done here if we require a separate patch for each ABI variant clang supports.
================ Comment at: clang/lib/CodeGen/TargetInfo.cpp:524 + if (isa<CXXRecordDecl>(RT->getDecl()) && + !(AllowNoUniqueAddr && FD->hasAttr<NoUniqueAddressAttr>())) return false; ---------------- Does this do the right thing with a field that's an array of empty classes? ================ Comment at: clang/lib/CodeGen/TargetInfo.cpp:7245 // do count. So do anonymous bitfields that aren't zero-sized. - if (getContext().getLangOpts().CPlusPlus && - FD->isZeroLengthBitField(getContext())) - continue; + if (getContext().getLangOpts().CPlusPlus) { + if (FD->isZeroLengthBitField(getContext())) ---------------- Only loosely relevant to this patch, but checking getLangOpts().CPlusPlus here seems weird; doesn't that break calling functions defined in C from C++ code? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81583/new/ https://reviews.llvm.org/D81583 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits