forked from OSchip/llvm-project
Patch to allow cstyle cast of objective-c pointers in objective-c++
mode as they are pervasive. llvm-svn: 90867
This commit is contained in:
parent
c5d082fd5d
commit
1c548021ec
|
@ -1160,6 +1160,10 @@ bool Sema::CXXCheckCStyleCast(SourceRange R, QualType CastTy, Expr *&CastExpr,
|
|||
if (CastTy->isDependentType() || CastExpr->isTypeDependent())
|
||||
return false;
|
||||
|
||||
// allow c-style cast of objective-c pointers as they are pervasive.
|
||||
if (CastTy->isObjCObjectPointerType())
|
||||
return false;
|
||||
|
||||
if (!CastTy->isLValueReferenceType() && !CastTy->isRecordType())
|
||||
DefaultFunctionArrayConversion(CastExpr);
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
// RUN: clang-cc -fsyntax-only -verify %s
|
||||
|
||||
@protocol P @end
|
||||
@interface I @end
|
||||
|
||||
int main() {
|
||||
void *cft;
|
||||
id oct = (id)cft;
|
||||
|
||||
Class ccct;
|
||||
ccct = (Class)cft;
|
||||
|
||||
I* iict = (I*)cft;
|
||||
|
||||
id<P> pid = (id<P>)cft;
|
||||
|
||||
I<P> *ip = (I<P>*)cft;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue