forked from OSchip/llvm-project
objc: DOn't complain if a (SEL) expression is typecast
to (SEL). Fixes // rdar://12859590 llvm-svn: 170058
This commit is contained in:
parent
193e1f738a
commit
b487388be1
|
@ -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;
|
||||
|
|
|
@ -18,4 +18,7 @@ int main() {
|
|||
(void *const)s; // ok
|
||||
|
||||
(const void *const)s; // ok
|
||||
|
||||
// rdar://12859590
|
||||
(SEL)sel_registerName("foo"); // ok
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue