[libcxx] r216909 - Fix PR#20834 - 'is_trivially_destructible yeilds wrong answer for arrays of unknown bound' Thanks to K-ballo for the bug report. Update a few of the other tests while we're here, and fix a typo in a test name.

Marshall Clow mclow.lists at gmail.com
Wed Oct 1 16:20:55 PDT 2014


On Oct 1, 2014, at 3:36 PM, Marshall Clow <mclow.lists at gmail.com> wrote:
> 
> Richard Smith pointed out that destroying a pointer to an objective-C class might require an ARC call, and so the compiler needs to see the type to figure out if it is_destructible.
> 
> Note that is_destructible<ObjCForwardClass**>::value is true, so it’s just pointers to objective-C objects, not pointers in general.

Richard also pointed me to: http://clang.llvm.org/docs/AutomaticReferenceCounting.html#retainable-object-pointers

So, while I agree with Argyrios that this changed the behavior of is_trivially_destructible for forward-declared objective-C classes,
I am now convinced that the old behavior was incorrect, and the new behavior is “better”.

One could argue that a forward-declared objective-C class is not a complete type, since the compiler doesn’t know how to destroy it, and if so, then is_destructible is not required to give any answer at all ("T shall be a complete type”).

— Marshall


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141001/8b52ae45/attachment.html>


More information about the cfe-commits mailing list