Lines Matching refs:SrcType

144 static bool CastsAwayConstness(Sema &Self, QualType SrcType, QualType DestType,
169 static TryCastResult TryStaticPointerDowncast(Sema &Self, QualType SrcType,
175 static TryCastResult TryStaticDowncast(Sema &Self, CanQualType SrcType,
183 QualType SrcType,
456 /// CastsAwayConstness - Check if the pointer conversion from SrcType to
465 CastsAwayConstness(Sema &Self, QualType SrcType, QualType DestType,
477 assert((SrcType->isAnyPointerType() || SrcType->isMemberPointerType() ||
478 SrcType->isBlockPointerType()) &&
484 QualType UnwrappedSrcType = Self.Context.getCanonicalType(SrcType),
582 QualType SrcType = Self.Context.getCanonicalType(OrigSrcType);
585 if (const PointerType *SrcPointer = SrcType->getAs<PointerType>()) {
597 SrcPointee = SrcType;
599 SrcPointee = SrcType;
691 QualType SrcType = SrcExpr->getType();
694 const CXXRecordDecl *SrcPointeeRD = SrcType->getPointeeCXXRecordDecl();
696 SrcPointeeRD ? SrcPointeeRD : SrcType->getAsCXXRecordDecl();
765 ReinterpretKind == ReinterpretUpcast? DestType : SrcType;
767 ReinterpretKind == ReinterpretUpcast? SrcType : DestType;
944 QualType SrcType = Self.Context.getCanonicalType(SrcExpr.get()->getType());
949 if (const EnumType *Enum = SrcType->getAs<EnumType>()) {
973 if (SrcType->isIntegralOrEnumerationType()) {
976 } else if (SrcType->isRealFloatingType()) {
984 tcr = TryStaticPointerDowncast(Self, SrcType, DestType, CStyle, OpRange, msg,
992 tcr = TryStaticMemberPointerUpcast(Self, SrcExpr, SrcType, DestType, CStyle,
1000 if (const PointerType *SrcPointer = SrcType->getAs<PointerType>()) {
1040 if (SrcType->isObjCObjectPointerType() &&
1138 TryStaticPointerDowncast(Sema &Self, QualType SrcType, QualType DestType,
1155 const PointerType *SrcPointer = SrcType->getAs<PointerType>();
1164 CStyle, OpRange, SrcType, DestType, msg, Kind,
1169 /// TryStaticPointerDowncast. Tests whether a static downcast from SrcType to
1172 TryStaticDowncast(Sema &Self, CanQualType SrcType, CanQualType DestType,
1177 if (Self.RequireCompleteType(OpRange.getBegin(), SrcType, 0) ||
1182 if (!DestType->getAs<RecordType>() || !SrcType->getAs<RecordType>()) {
1188 if (!Self.IsDerivedFrom(DestType, SrcType, Paths)) {
1211 if (!CStyle && !DestType.isAtLeastAsQualifiedAs(SrcType)) {
1216 if (Paths.isAmbiguous(SrcType.getUnqualifiedType())) {
1224 Self.IsDerivedFrom(DestType, SrcType, Paths);
1243 << QualType(SrcType).getUnqualifiedType()
1260 SrcType, DestType,
1287 TryStaticMemberPointerUpcast(Sema &Self, ExprResult &SrcExpr, QualType SrcType,
1303 SrcType = Self.Context.getMemberPointerType(Fn->getType(),
1309 const MemberPointerType *SrcMemPtr = SrcType->getAs<MemberPointerType>();
1453 QualType SrcType = SrcExpr->getType();
1476 SrcType = Self.Context.getPointerType(SrcType);
1503 SrcType = Self.Context.getCanonicalType(SrcType);
1510 while (SrcType != DestType &&
1511 Self.Context.UnwrapSimilarPointerTypes(SrcType, DestType)) {
1513 SrcType = Self.Context.getUnqualifiedArrayType(SrcType, SrcQuals);
1525 if (SrcType != DestType)
1536 void Sema::CheckCompatibleReinterpretCast(QualType SrcType, QualType DestType,
1550 if (!SrcType->getAs<PointerType>() || !DestType->getAs<PointerType>()) {
1553 SrcTy = SrcType->getPointeeType();
1559 SrcTy = SrcType;
1585 Diag(Range.getBegin(), DiagID) << SrcType << DestType << Range;
1590 QualType SrcType = SrcExpr.get()->getType();
1591 if (Self.Context.hasSameType(SrcType, DestType))
1593 if (const PointerType *SrcPtrTy = SrcType->getAs<PointerType>())
1601 << SrcType << DestType << SrcExpr.get()->getSourceRange();
1608 QualType SrcType = SrcExpr->getType();
1613 if (CStyle && SrcType->isIntegralType(Self.Context)
1614 && !SrcType->isBooleanType()
1615 && !SrcType->isEnumeralType()
1617 && Self.Context.getTypeSize(DestType) > Self.Context.getTypeSize(SrcType))
1618 Self.Diag(Loc, diag::warn_int_to_pointer_cast) << SrcType << DestType;
1629 QualType SrcType = SrcExpr.get()->getType();
1633 if (SrcType == Self.Context.OverloadTy) {
1643 SrcType = SrcExpr.get()->getType();
1658 Self.CheckCompatibleReinterpretCast(SrcType, DestType,
1686 SrcType = Self.Context.getPointerType(SrcType);
1692 SrcType = Self.Context.getCanonicalType(SrcType);
1695 *SrcMemPtr = SrcType->getAs<MemberPointerType>();
1709 if (CastsAwayConstness(Self, SrcType, DestType, /*CheckCVR=*/!CStyle,
1729 if (SrcType->isNullPtrType() && DestType->isIntegralType(Self.Context)) {
1734 if (Self.Context.getTypeSize(SrcType) >
1744 bool srcIsVector = SrcType->isVectorType();
1747 bool srcIsScalar = SrcType->isIntegralType(Self.Context);
1756 if (Self.Context.getTypeSize(SrcType)
1772 if (SrcType == DestType) {
1783 if (SrcType->isIntegralOrEnumerationType() ||
1784 SrcType->isAnyPointerType() ||
1785 SrcType->isMemberPointerType() ||
1786 SrcType->isBlockPointerType()) {
1794 bool srcIsPtr = SrcType->isAnyPointerType() ||
1795 SrcType->isBlockPointerType();
1807 if ((Self.Context.getTypeSize(SrcType) >
1817 if (SrcType->isIntegralOrEnumerationType()) {
1837 if (CastsAwayConstness(Self, SrcType, DestType, /*CheckCVR=*/!CStyle,
1844 if ((SrcType->isBlockPointerType() && DestType->isObjCObjectPointerType()) ||
1845 (DestType->isBlockPointerType() && SrcType->isObjCObjectPointerType()))
1853 if (!SrcType->isBlockPointerType()) {
1873 if (SrcType->isFunctionPointerType()) {
2047 QualType SrcType = SrcExpr.get()->getType();
2050 if ((SrcType->isAnyPointerType() || SrcType->isBlockPointerType())
2053 if (SrcType->isIntegerType() && DestType->isIntegerType() &&
2054 (SrcType->isBooleanType() == DestType->isBooleanType()) &&
2055 (SrcType->isEnumeralType() == DestType->isEnumeralType()))
2057 if (SrcType->isRealFloatingType() && DestType->isRealFloatingType())
2059 if (SrcType->isEnumeralType() && DestType->isEnumeralType())
2061 if (SrcType->isComplexType() && DestType->isComplexType())
2063 if (SrcType->isComplexIntegerType() && DestType->isComplexIntegerType())
2068 << SrcType << DestType << SrcExpr.get()->getSourceRange();
2099 QualType SrcType = SrcExpr.get()->getType();
2101 assert(!SrcType->isPlaceholderType());
2112 if (DestRecordTy && Self.Context.hasSameUnqualifiedType(DestType, SrcType)){
2126 if (Self.Context.hasSameUnqualifiedType(Field->getType(), SrcType) &&
2135 << SrcType << SrcExpr.get()->getSourceRange();
2153 if (!SrcType->isScalarType() && !SrcType->isVectorType()) {
2156 << SrcType << SrcExpr.get()->getSourceRange();
2168 (SrcType->isIntegerType() || SrcType->isFloatingType())) {
2170 } else if (Self.CheckVectorCast(OpRange, DestType, SrcType, Kind)) {
2176 if (SrcType->isVectorType()) {
2177 if (Self.CheckVectorCast(OpRange, SrcType, DestType, Kind))
2196 if (!SrcType->isIntegralType(Self.Context) && SrcType->isArithmeticType()) {
2199 << SrcType << SrcExpr.get()->getSourceRange();
2205 } else if (!SrcType->isArithmeticType()) {
2232 if (const PointerType *ExprPtr = SrcType->getAs<PointerType>()) {
2240 << SrcType << DestType << Sema::AA_Casting
2246 else if (!Self.CheckObjCARCUnavailableWeakConversion(DestType, SrcType)) {
2249 << 1 << SrcType << DestType << SrcExpr.get()->getSourceRange();