This is an archive of the discontinued LLVM Phabricator instance.

[Sema][ObjC++] Objective-C++ support for __is_base_of(B, D)
ClosedPublic

Authored by erik.pilkington on May 4 2017, 6:51 PM.

Details

Summary

This patch adds Objective-C interfaces support for the type trait is_base_of, so that __is_base_of(NSString, NSMutableString) is true.

rdar://24308607

Thanks for taking a look!
Erik

Diff Detail

Repository
rL LLVM

Event Timeline

erik.pilkington created this revision.May 4 2017, 6:51 PM
arphaman accepted this revision.May 10 2017, 7:43 AM
arphaman added a subscriber: arphaman.

LGTM! A couple of comments below:

lib/Sema/SemaExprCXX.cpp
4725 ↗(On Diff #97905)

Please capitalize lhsObjTy and rhsObjTy.

test/SemaObjCXX/is-base-of.mm
14 ↗(On Diff #97905)

I'd also add a test that verifies that id isn't a valid base, e.g:

static_assert(!__is_base_of(id, NSObj), "");
This revision is now accepted and ready to land.May 10 2017, 7:43 AM
This revision was automatically updated to reflect the committed changes.