diff options
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 18 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 8 | 
2 files changed, 4 insertions, 22 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 5c886b8983a..fb28fd43670 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 98d3a23e600..da32d4ec106 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/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();      }  | 

