objc: DOn't complain if a (SEL) expression is typecast

to (SEL). Fixes // rdar://12859590

llvm-svn: 170058
This commit is contained in:
Fariborz Jahanian 2012-12-13 00:42:06 +00:00
parent 193e1f738a
commit b487388be1
2 changed files with 5 additions and 0 deletions

View File

@ -1479,6 +1479,8 @@ void Sema::CheckCompatibleReinterpretCast(QualType SrcType, QualType DestType,
static void DiagnoseCastOfObjCSEL(Sema &Self, const ExprResult &SrcExpr,
QualType DestType) {
QualType SrcType = SrcExpr.get()->getType();
if (Self.Context.hasSameType(SrcType, DestType))
return;
if (const PointerType *SrcPtrTy = SrcType->getAs<PointerType>())
if (SrcPtrTy->isObjCSelType()) {
QualType DT = DestType;

View File

@ -18,4 +18,7 @@ int main() {
(void *const)s; // ok
(const void *const)s; // ok
// rdar://12859590
(SEL)sel_registerName("foo"); // ok
}