Index: clang/lib/Sema/SemaExprObjC.cpp =================================================================== --- clang/lib/Sema/SemaExprObjC.cpp +++ clang/lib/Sema/SemaExprObjC.cpp @@ -2438,6 +2438,9 @@ if (!ReceiverType.isNull()) receiverTypeInfo = Context.getTrivialTypeSourceInfo(ReceiverType); + assert(((isSuperReceiver && Loc.isValid()) || receiverTypeInfo) && + "Either the super receiver location needs to be valid or the receiver " + "needs valid type source information"); return BuildClassMessage(receiverTypeInfo, ReceiverType, /*SuperLoc=*/isSuperReceiver ? Loc : SourceLocation(), Sel, Method, Loc, Loc, Loc, Args, Index: clang/lib/Sema/SemaObjCProperty.cpp =================================================================== --- clang/lib/Sema/SemaObjCProperty.cpp +++ clang/lib/Sema/SemaObjCProperty.cpp @@ -1363,10 +1363,9 @@ if (!Context.hasSameType(PropertyIvarType, IvarType)) { if (isa(PropertyIvarType) && isa(IvarType)) - compat = - Context.canAssignObjCInterfaces( - PropertyIvarType->getAs(), - IvarType->getAs()); + compat = Context.canAssignObjCInterfaces( + PropertyIvarType->castAs(), + IvarType->castAs()); else { compat = (CheckAssignmentConstraints(PropertyIvarLoc, PropertyIvarType, IvarType) Index: clang/lib/Sema/SemaType.cpp =================================================================== --- clang/lib/Sema/SemaType.cpp +++ clang/lib/Sema/SemaType.cpp @@ -2708,8 +2708,8 @@ return QualType(); } // Only support _BitInt elements with byte-sized power of 2 NumBits. - if (CurType->isBitIntType()) { - unsigned NumBits = CurType->getAs()->getNumBits(); + if (const auto *BIT = CurType->getAs()) { + unsigned NumBits = BIT->getNumBits(); if (!llvm::isPowerOf2_32(NumBits) || NumBits < 8) { Diag(AttrLoc, diag::err_attribute_invalid_bitint_vector_type) << (NumBits < 8);