Lines Matching defs:SrcType
145 static bool CastsAwayConstness(Sema &Self, QualType SrcType, QualType DestType,
170 static TryCastResult TryStaticPointerDowncast(Sema &Self, QualType SrcType,
176 static TryCastResult TryStaticDowncast(Sema &Self, CanQualType SrcType,
184 QualType SrcType,
329 QualType srcType = src->getType();
330 if (!destType->isRecordType() && !srcType->isRecordType())
378 << CT << srcType << destType
455 /// CastsAwayConstness - Check if the pointer conversion from SrcType to
464 CastsAwayConstness(Sema &Self, QualType SrcType, QualType DestType,
476 assert((SrcType->isAnyPointerType() || SrcType->isMemberPointerType() ||
477 SrcType->isBlockPointerType()) &&
483 QualType UnwrappedSrcType = Self.Context.getCanonicalType(SrcType),
585 QualType SrcType = Self.Context.getCanonicalType(OrigSrcType);
588 if (const PointerType *SrcPointer = SrcType->getAs<PointerType>()) {
601 SrcPointee = SrcType;
607 SrcType, SrcExpr.get(), /*IsLValueReference*/false);
608 SrcPointee = SrcType;
718 QualType SrcType = SrcExpr->getType();
721 const CXXRecordDecl *SrcPointeeRD = SrcType->getPointeeCXXRecordDecl();
723 SrcPointeeRD ? SrcPointeeRD : SrcType->getAsCXXRecordDecl();
793 ReinterpretKind == ReinterpretUpcast? DestType : SrcType;
795 ReinterpretKind == ReinterpretUpcast? SrcType : DestType;
974 QualType SrcType = Self.Context.getCanonicalType(SrcExpr.get()->getType());
979 if (const EnumType *Enum = SrcType->getAs<EnumType>()) {
1003 if (SrcType->isIntegralOrEnumerationType()) {
1006 } else if (SrcType->isRealFloatingType()) {
1014 tcr = TryStaticPointerDowncast(Self, SrcType, DestType, CStyle, OpRange, msg,
1022 tcr = TryStaticMemberPointerUpcast(Self, SrcExpr, SrcType, DestType, CStyle,
1030 if (const PointerType *SrcPointer = SrcType->getAs<PointerType>()) {
1070 if (SrcType->isObjCObjectPointerType() &&
1176 TryStaticPointerDowncast(Sema &Self, QualType SrcType, QualType DestType,
1193 const PointerType *SrcPointer = SrcType->getAs<PointerType>();
1202 CStyle, OpRange, SrcType, DestType, msg, Kind,
1207 /// TryStaticPointerDowncast. Tests whether a static downcast from SrcType to
1210 TryStaticDowncast(Sema &Self, CanQualType SrcType, CanQualType DestType,
1215 if (Self.RequireCompleteType(OpRange.getBegin(), SrcType, 0) ||
1220 if (!DestType->getAs<RecordType>() || !SrcType->getAs<RecordType>()) {
1226 SrcType, Paths)) {
1249 if (!CStyle && !DestType.isAtLeastAsQualifiedAs(SrcType)) {
1254 if (Paths.isAmbiguous(SrcType.getUnqualifiedType())) {
1262 Self.IsDerivedFrom(DestType, SrcType, Paths);
1281 << QualType(SrcType).getUnqualifiedType()
1298 SrcType, DestType,
1325 TryStaticMemberPointerUpcast(Sema &Self, ExprResult &SrcExpr, QualType SrcType,
1341 SrcType = Self.Context.getMemberPointerType(Fn->getType(),
1347 const MemberPointerType *SrcMemPtr = SrcType->getAs<MemberPointerType>();
1497 QualType SrcType = SrcExpr.get()->getType();
1521 if (!SrcType->isRecordType()) {
1544 SrcType = Self.Context.getPointerType(SrcType);
1571 SrcType = Self.Context.getCanonicalType(SrcType);
1578 while (SrcType != DestType &&
1579 Self.Context.UnwrapSimilarPointerTypes(SrcType, DestType)) {
1581 SrcType = Self.Context.getUnqualifiedArrayType(SrcType, SrcQuals);
1593 if (SrcType != DestType)
1600 SrcType, SrcExpr.get(), /*IsLValueReference*/ false);
1610 void Sema::CheckCompatibleReinterpretCast(QualType SrcType, QualType DestType,
1622 if (!SrcType->getAs<PointerType>() || !DestType->getAs<PointerType>()) {
1625 SrcTy = SrcType->getPointeeType();
1631 SrcTy = SrcType;
1657 Diag(Range.getBegin(), DiagID) << SrcType << DestType << Range;
1662 QualType SrcType = SrcExpr.get()->getType();
1663 if (Self.Context.hasSameType(SrcType, DestType))
1665 if (const PointerType *SrcPtrTy = SrcType->getAs<PointerType>())
1673 << SrcType << DestType << SrcExpr.get()->getSourceRange();
1680 QualType SrcType = SrcExpr->getType();
1685 if (CStyle && SrcType->isIntegralType(Self.Context)
1686 && !SrcType->isBooleanType()
1687 && !SrcType->isEnumeralType()
1690 Self.Context.getTypeSize(SrcType)) {
1699 Self.Diag(Loc, Diag) << SrcType << DestType;
1711 QualType SrcType = SrcExpr.get()->getType();
1715 if (SrcType == Self.Context.OverloadTy) {
1725 SrcType = SrcExpr.get()->getType();
1740 Self.CheckCompatibleReinterpretCast(SrcType, DestType,
1768 SrcType = Self.Context.getPointerType(SrcType);
1774 SrcType = Self.Context.getCanonicalType(SrcType);
1777 *SrcMemPtr = SrcType->getAs<MemberPointerType>();
1791 if (CastsAwayConstness(Self, SrcType, DestType, /*CheckCVR=*/!CStyle,
1800 Self.RequireCompleteType(OpRange.getBegin(), SrcType, 0);
1818 if (SrcType->isNullPtrType() && DestType->isIntegralType(Self.Context)) {
1823 if (Self.Context.getTypeSize(SrcType) >
1833 bool srcIsVector = SrcType->isVectorType();
1836 bool srcIsScalar = SrcType->isIntegralType(Self.Context);
1845 if (Self.Context.getTypeSize(SrcType)
1861 if (SrcType == DestType) {
1872 if (SrcType->isIntegralOrEnumerationType() ||
1873 SrcType->isAnyPointerType() ||
1874 SrcType->isMemberPointerType() ||
1875 SrcType->isBlockPointerType()) {
1883 bool srcIsPtr = SrcType->isAnyPointerType() ||
1884 SrcType->isBlockPointerType();
1898 if ((Self.Context.getTypeSize(SrcType) >
1908 if (SrcType->isIntegralOrEnumerationType()) {
1928 if (CastsAwayConstness(Self, SrcType, DestType, /*CheckCVR=*/!CStyle,
1935 if ((SrcType->isBlockPointerType() && DestType->isObjCObjectPointerType()) ||
1936 (DestType->isBlockPointerType() && SrcType->isObjCObjectPointerType()))
1944 if (!SrcType->isBlockPointerType()) {
1964 if (SrcType->isFunctionPointerType()) {
2143 QualType SrcType = SrcExpr.get()->getType();
2146 if ((SrcType->isAnyPointerType() || SrcType->isBlockPointerType())
2149 if (SrcType->isIntegerType() && DestType->isIntegerType() &&
2150 (SrcType->isBooleanType() == DestType->isBooleanType()) &&
2151 (SrcType->isEnumeralType() == DestType->isEnumeralType()))
2153 if (SrcType->isRealFloatingType() && DestType->isRealFloatingType())
2155 if (SrcType->isEnumeralType() && DestType->isEnumeralType())
2157 if (SrcType->isComplexType() && DestType->isComplexType())
2159 if (SrcType->isComplexIntegerType() && DestType->isComplexIntegerType())
2164 << SrcType << DestType << SrcExpr.get()->getSourceRange();
2195 QualType SrcType = SrcExpr.get()->getType();
2197 assert(!SrcType->isPlaceholderType());
2202 SrcType->isPointerType()) {
2204 SrcType->getPointeeType().getAddressSpace()) {
2207 << SrcType << DestType << Sema::AA_Casting
2223 if (DestRecordTy && Self.Context.hasSameUnqualifiedType(DestType, SrcType)){
2237 if (Self.Context.hasSameUnqualifiedType(Field->getType(), SrcType) &&
2246 << SrcType << SrcExpr.get()->getSourceRange();
2264 if (!SrcType->isScalarType() && !SrcType->isVectorType()) {
2267 << SrcType << SrcExpr.get()->getSourceRange();
2279 (SrcType->isIntegerType() || SrcType->isFloatingType())) {
2281 } else if (Self.CheckVectorCast(OpRange, DestType, SrcType, Kind)) {
2287 if (SrcType->isVectorType()) {
2288 if (Self.CheckVectorCast(OpRange, SrcType, DestType, Kind))
2307 if (!SrcType->isIntegralType(Self.Context) && SrcType->isArithmeticType()) {
2310 << SrcType << SrcExpr.get()->getSourceRange();
2316 } else if (!SrcType->isArithmeticType()) {
2343 if (const PointerType *ExprPtr = SrcType->getAs<PointerType>()) {
2351 << SrcType << DestType << Sema::AA_Casting
2357 else if (!Self.CheckObjCARCUnavailableWeakConversion(DestType, SrcType)) {
2360 << 1 << SrcType << DestType << SrcExpr.get()->getSourceRange();