dblaikie added inline comments.

================
Comment at: clang/lib/AST/Decl.cpp:4510-4512
+    for (const FieldDecl *Field : CXXRD->fields())
+      if (Field->getType()->getAsCXXRecordDecl())
+        return false;
----------------
maybe `llvm::any_of`? Not especially shorter, but maybe makes it a smidge 
easier to read?


================
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();
----------------
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?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157762

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to