[PATCH] D157762: [WIP] Implement [[msvc::no_unique_address]]

Amy Huang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 17 13:01:55 PDT 2023


akhuang added inline comments.


================
Comment at: clang/lib/AST/Decl.cpp:4523-4524
 bool FieldDecl::isPotentiallyOverlapping() const {
-  return hasAttr<NoUniqueAddressAttr>() && getType()->getAsCXXRecordDecl();
+  return (hasAttr<NoUniqueAddressAttr>() ||
+          hasAttr<NoUniqueAddressMSVCAttr>()) &&
+         getType()->getAsCXXRecordDecl();
----------------
aaron.ballman wrote:
> dblaikie wrote:
> > Having to check both of these in several places seems problematic - can we wrap that up somewhere? (or, maybe ideally, is there a way for `msvc::no_unique_address` to map to the actual NoUniqueAddressAttr as a different spelling of the same thing?)
> This was why I was hoping we could merge the two in Attr.td, but I'm not certain that will be easy.
What does merging the two in Attr.td mean? Could we just put the two spellings in one attribute, or would that make it impossible for clang-cl to ignore the [[no_unique_address]] spelling


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157762/new/

https://reviews.llvm.org/D157762



More information about the cfe-commits mailing list