diff options
-rw-r--r-- | include/clang/AST/ASTContext.h | 1 | ||||
-rw-r--r-- | lib/AST/ASTContext.cpp | 18 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 8 |
3 files changed, 4 insertions, 23 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index cad5487ea3..b02faa8ff3 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -696,7 +696,6 @@ public: /// Compatibility predicates used to check assignment expressions. bool typesAreCompatible(QualType, QualType); // C99 6.2.7p1 - bool typesAreBlockCompatible(QualType lhs, QualType rhs); bool isObjCIdType(QualType T) const { return T == ObjCIdType; diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 5c886b8983..fb28fd4367 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2838,24 +2838,6 @@ QualType::GCAttrTypes ASTContext::getObjCGCAttrKind(const QualType &Ty) const { // Type Compatibility Testing //===----------------------------------------------------------------------===// -/// typesAreBlockCompatible - This routine is called when comparing two -/// block types. Types must be strictly compatible here. For example, -/// C unfortunately doesn't produce an error for the following: -/// -/// int (*emptyArgFunc)(); -/// int (*intArgList)(int) = emptyArgFunc; -/// -/// For blocks, we will produce an error for the following (similar to C++): -/// -/// int (^emptyArgBlock)(); -/// int (^intArgBlock)(int) = emptyArgBlock; -/// -/// FIXME: When the dust settles on this integration, fold this into mergeTypes. -/// -bool ASTContext::typesAreBlockCompatible(QualType lhs, QualType rhs) { - return !mergeTypes(lhs, rhs).isNull(); -} - /// areCompatVectorTypes - Return true if the two specified vector types are /// compatible. static bool areCompatVectorTypes(const VectorType *LHS, diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 98d3a23e60..da32d4ec10 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -3003,8 +3003,8 @@ QualType Sema::CheckConditionalOperands(Expr *&Cond, Expr *&LHS, Expr *&RHS, compositeType = Context.getObjCIdType(); } else if (LHSBPT || RHSBPT) { if (!sameKind - || !Context.typesAreBlockCompatible(lhptee.getUnqualifiedType(), - rhptee.getUnqualifiedType())) + || !Context.typesAreCompatible(lhptee.getUnqualifiedType(), + rhptee.getUnqualifiedType())) Diag(QuestionLoc, diag::err_typecheck_cond_incompatible_operands) << LHSTy << RHSTy << LHS->getSourceRange() << RHS->getSourceRange(); return QualType(); @@ -3218,7 +3218,7 @@ Sema::CheckBlockPointerTypesForAssignment(QualType lhsType, if (lhptee.getCVRQualifiers() != rhptee.getCVRQualifiers()) ConvTy = CompatiblePointerDiscardsQualifiers; - if (!Context.typesAreBlockCompatible(lhptee, rhptee)) + if (!Context.typesAreCompatible(lhptee, rhptee)) return IncompatibleBlockPointer; return ConvTy; } @@ -3978,7 +3978,7 @@ QualType Sema::CheckCompareOperands(Expr *&lex, Expr *&rex, SourceLocation Loc, QualType rpointee = rType->getAsBlockPointerType()->getPointeeType(); if (!LHSIsNull && !RHSIsNull && - !Context.typesAreBlockCompatible(lpointee, rpointee)) { + !Context.typesAreCompatible(lpointee, rpointee)) { Diag(Loc, diag::err_typecheck_comparison_of_distinct_blocks) << lType << rType << lex->getSourceRange() << rex->getSourceRange(); } |