diff options
-rw-r--r-- | include/clang/AST/Type.h | 2 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 6 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 2026b226c5..c6f8baa202 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -4168,7 +4168,7 @@ public: static void Profile(llvm::FoldingSetNodeID &ID, QualType Pattern, Optional<unsigned> NumExpansions) { ID.AddPointer(Pattern.getAsOpaquePtr()); - ID.AddBoolean(NumExpansions); + ID.AddBoolean(NumExpansions.hasValue()); if (NumExpansions) ID.AddInteger(*NumExpansions); } diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 4ddbdd2c3c..ec16efdf9d 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -7159,7 +7159,7 @@ QualType Sema::CheckCompareOperands(ExprResult &LHS, ExprResult &RHS, if ((LCanPointeeTy->isFunctionType() || RCanPointeeTy->isFunctionType()) && !LHSIsNull && !RHSIsNull) { diagnoseFunctionPointerToVoidComparison( - *this, Loc, LHS, RHS, /*isError*/ isSFINAEContext()); + *this, Loc, LHS, RHS, /*isError*/ (bool)isSFINAEContext()); if (isSFINAEContext()) return QualType(); @@ -8096,8 +8096,8 @@ static QualType CheckAddressOfOperand(Sema &S, ExprResult &OrigOp, unsigned AddressOfError = AO_No_Error; if (lval == Expr::LV_ClassTemporary || lval == Expr::LV_ArrayTemporary) { - bool sfinae = S.isSFINAEContext(); - S.Diag(OpLoc, sfinae ? diag::err_typecheck_addrof_temporary + bool sfinae = (bool)S.isSFINAEContext(); + S.Diag(OpLoc, S.isSFINAEContext() ? diag::err_typecheck_addrof_temporary : diag::ext_typecheck_addrof_temporary) << op->getType() << op->getSourceRange(); if (sfinae) diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp index 85b930567f..26dbb7f250 100644 --- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp +++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp @@ -84,7 +84,7 @@ static FoundationClass findKnownClass(const ObjCInterfaceDecl *ID) { } static inline bool isNil(SVal X) { - return X.getAs<loc::ConcreteInt>(); + return X.getAs<loc::ConcreteInt>().hasValue(); } //===----------------------------------------------------------------------===// |