This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Correctly handle Objective-C++ ARC qualifiers in std::is_pointer
ClosedPublic

Authored by ldionne on Apr 1 2019, 12:00 PM.

Event Timeline

ldionne created this revision.Apr 1 2019, 12:00 PM

Do we have to worry about other pointer types than id?

Do we have to worry about other pointer types than id?

Yes, we do. Is it OK to include <Foundation/Foundation.h> in the libc++ test suite? I haven't seen it done before.

ldionne updated this revision to Diff 193315.Apr 2 2019, 9:35 AM

Add test for pointers to Objective-C classes.

Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2019, 9:35 AM
ahatanak accepted this revision.Apr 2 2019, 11:08 AM

LGTM

libcxx/test/libcxx/type_traits/is_pointer_objc.arc.pass.mm
27

I think you can just declare Foo with __attribute__((objc_root_class)) or just @class Foo. You don't need Foundation.h.

This revision is now accepted and ready to land.Apr 2 2019, 11:08 AM
ahatanak added inline comments.Apr 2 2019, 11:14 AM
libcxx/test/libcxx/type_traits/is_pointer_objc.arc.pass.mm
22

Also, can you add a test case that tests the combination of const or volatile and __weak?

std::is_pointer<__weak const id>
ldionne updated this revision to Diff 193344.Apr 2 2019, 12:42 PM

Add tests for variations of cv-qualifiers, and remove Foundation.h

ldionne updated this revision to Diff 193346.Apr 2 2019, 12:43 PM

Add tests for cv-qualifiers of id

Harbormaster completed remote builds in B29962: Diff 193346.
This revision was automatically updated to reflect the committed changes.
ldionne reopened this revision.Apr 3 2019, 7:11 AM

This was reverted in r357569 because it broke the Chromium build.

This revision is now accepted and ready to land.Apr 3 2019, 7:11 AM
ldionne updated this revision to Diff 193493.Apr 3 2019, 7:24 AM

Updated patch with fix for void pointers.

This revision was automatically updated to reflect the committed changes.