[PATCH] D57438: [Sema][ObjC] Allow declaring ObjC pointer members in C++ unions under ARC

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 31 20:33:55 PST 2019


rjmccall added inline comments.


================
Comment at: lib/Sema/SemaDeclCXX.cpp:7084
 
+  if (FD->getParent()->isUnion() &&
+      shouldDeleteForVariantObjCPtrMember(FD, FieldType))
----------------
rjmccall wrote:
> I believe the right check for variant-ness is `inUnion()`, not `FD->getParent()->isUnion()`, since the latter can miss cases with e.g. anonymous `struct`s.
Can you try adding a test case here for an anonymous struct nested within an anonymous union?


Repository:
  rC Clang

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

https://reviews.llvm.org/D57438





More information about the cfe-commits mailing list