rjmccall added a comment.

I agree that the new-expression case doesn't use the destructor, and all the 
other cases of list-initialization presumably use the destructor for the 
initialized type for separate reasons.  Ok.



================
Comment at: test/CodeGenObjCXX/arc-list-init-destruct.mm:1
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -std=c++1z -fobjc-arc 
-fobjc-exceptions -fcxx-exceptions -fexceptions -emit-llvm -o - %s | FileCheck 
%s
+
----------------
ahatanak wrote:
> rjmccall wrote:
> > Does the corresponding C++ test case (replacing `Class0 *f;` with 
> > `HasExplicitNonTrivialDestructor f;`) not reproduce the problem?
> I wasn't able to reproduce the problem by changing the type of field 'f' to a 
> C++ class with a non-trivial destructor because, if I make that change, 
> Class1's destructor declaration gets added in 
> Sema::AddImplicitlyDeclaredMembersToClass. I don't fully understand the 
> reason behind it, but Class1's destructor declaration is added when the type 
> of one of its subobject has a user-declared destructor.
Interesting, alright.


Repository:
  rC Clang

https://reviews.llvm.org/D45898



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D45898: [... Akira Hatanaka via Phabricator via cfe-commits
    • [PATCH] D458... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D458... John McCall via Phabricator via cfe-commits
    • [PATCH] D458... Akira Hatanaka via Phabricator via cfe-commits

Reply via email to