Home | History | Annotate | Download | only in Sema

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,
326 QualType srcType = src->getType();
327 if (!destType->isRecordType() && !srcType->isRecordType())
375 << CT << srcType << destType
452 /// CastsAwayConstness - Check if the pointer conversion from SrcType to
461 CastsAwayConstness(Sema &Self, QualType SrcType, QualType DestType,
473 assert((SrcType->isAnyPointerType() || SrcType->isMemberPointerType() ||
474 SrcType->isBlockPointerType()) &&
480 QualType UnwrappedSrcType = Self.Context.getCanonicalType(SrcType),
582 QualType SrcType = Self.Context.getCanonicalType(OrigSrcType);
585 if (const PointerType *SrcPointer = SrcType->getAs<PointerType>()) {
598 SrcPointee = SrcType;
600 SrcPointee = SrcType;
708 QualType SrcType = SrcExpr->getType();
711 const CXXRecordDecl *SrcPointeeRD = SrcType->getPointeeCXXRecordDecl();
713 SrcPointeeRD ? SrcPointeeRD : SrcType->getAsCXXRecordDecl();
783 ReinterpretKind == ReinterpretUpcast? DestType : SrcType;
785 ReinterpretKind == ReinterpretUpcast? SrcType : DestType;
964 QualType SrcType = Self.Context.getCanonicalType(SrcExpr.get()->getType());
969 if (const EnumType *Enum = SrcType->getAs<EnumType>()) {
993 if (SrcType->isIntegralOrEnumerationType()) {
996 } else if (SrcType->isRealFloatingType()) {
1004 tcr = TryStaticPointerDowncast(Self, SrcType, DestType, CStyle, OpRange, msg,
1012 tcr = TryStaticMemberPointerUpcast(Self, SrcExpr, SrcType, DestType, CStyle,
1020 if (const PointerType *SrcPointer = SrcType->getAs<PointerType>()) {
1060 if (SrcType->isObjCObjectPointerType() &&
1158 TryStaticPointerDowncast(Sema &Self, QualType SrcType, QualType DestType,
1175 const PointerType *SrcPointer = SrcType->getAs<PointerType>();
1184 CStyle, OpRange, SrcType, DestType, msg, Kind,
1189 /// TryStaticPointerDowncast. Tests whether a static downcast from SrcType to
1192 TryStaticDowncast(Sema &Self, CanQualType SrcType, CanQualType DestType,
1197 if (Self.RequireCompleteType(OpRange.getBegin(), SrcType, 0) ||
1202 if (!DestType->getAs<RecordType>() || !SrcType->getAs<RecordType>()) {
1208 if (!Self.IsDerivedFrom(DestType, SrcType, Paths)) {
1231 if (!CStyle && !DestType.isAtLeastAsQualifiedAs(SrcType)) {
1236 if (Paths.isAmbiguous(SrcType.getUnqualifiedType())) {
1244 Self.IsDerivedFrom(DestType, SrcType, Paths);
1263 << QualType(SrcType).getUnqualifiedType()
1280 SrcType, DestType,
1307 TryStaticMemberPointerUpcast(Sema &Self, ExprResult &SrcExpr, QualType SrcType,
1323 SrcType = Self.Context.getMemberPointerType(Fn->getType(),
1329 const MemberPointerType *SrcMemPtr = SrcType->getAs<MemberPointerType>();
1474 QualType SrcType = SrcExpr.get()->getType();
1498 if (!SrcType->isRecordType()) {
1521 SrcType = Self.Context.getPointerType(SrcType);
1548 SrcType = Self.Context.getCanonicalType(SrcType);
1555 while (SrcType != DestType &&
1556 Self.Context.UnwrapSimilarPointerTypes(SrcType, DestType)) {
1558 SrcType = Self.Context.getUnqualifiedArrayType(SrcType, SrcQuals);
1570 if (SrcType != DestType)
1577 SrcType, SrcExpr.take(), /*IsLValueReference*/ false,
1588 void Sema::CheckCompatibleReinterpretCast(QualType SrcType, QualType DestType,
1602 if (!SrcType->getAs<PointerType>() || !DestType->getAs<PointerType>()) {
1605 SrcTy = SrcType->getPointeeType();
1611 SrcTy = SrcType;
1637 Diag(Range.getBegin(), DiagID) << SrcType << DestType << Range;
1642 QualType SrcType = SrcExpr.get()->getType();
1643 if (Self.Context.hasSameType(SrcType, DestType))
1645 if (const PointerType *SrcPtrTy = SrcType->getAs<PointerType>())
1653 << SrcType << DestType << SrcExpr.get()->getSourceRange();
1660 SrcType = SrcExpr->getType();
1665 if (CStyle && SrcType->isIntegralType(Self.Context)
1666 && !SrcType->isBooleanType()
1667 && !SrcType->isEnumeralType()
1670 Self.Context.getTypeSize(SrcType)) {
1679 Self.Diag(Loc, Diag) << SrcType << DestType;
1691 QualType SrcType = SrcExpr.get()->getType();
1695 if (SrcType == Self.Context.OverloadTy) {
1705 SrcType = SrcExpr.get()->getType();
1720 Self.CheckCompatibleReinterpretCast(SrcType, DestType,
1748 SrcType = Self.Context.getPointerType(SrcType);
1754 SrcType = Self.Context.getCanonicalType(SrcType);
1757 *SrcMemPtr = SrcType->getAs<MemberPointerType>();
1771 if (CastsAwayConstness(Self, SrcType, DestType, /*CheckCVR=*/!CStyle,
1791 if (SrcType->isNullPtrType() && DestType->isIntegralType(Self.Context)) {
1796 if (Self.Context.getTypeSize(SrcType) >
1806 bool srcIsVector = SrcType->isVectorType();
1809 bool srcIsScalar = SrcType->isIntegralType(Self.Context);
1818 if (Self.Context.getTypeSize(SrcType)
1834 if (SrcType == DestType) {
1845 if (SrcType->isIntegralOrEnumerationType() ||
1846 SrcType->isAnyPointerType() ||
1847 SrcType->isMemberPointerType() ||
1848 SrcType->isBlockPointerType()) {
1856 bool srcIsPtr = SrcType->isAnyPointerType() ||
1857 SrcType->isBlockPointerType();
1871 if ((Self.Context.getTypeSize(SrcType) >
1881 if (SrcType->isIntegralOrEnumerationType()) {
1901 if (CastsAwayConstness(Self, SrcType, DestType, /*CheckCVR=*/!CStyle,
1908 if ((SrcType->isBlockPointerType() && DestType->isObjCObjectPointerType()) ||
1909 (DestType->isBlockPointerType() && SrcType->isObjCObjectPointerType()))
1917 if (!SrcType->isBlockPointerType()) {
1937 if (SrcType->isFunctionPointerType()) {
2110 QualType SrcType = SrcExpr.get()->getType();
2113 if ((SrcType->isAnyPointerType() || SrcType->isBlockPointerType())
2116 if (SrcType->isIntegerType() && DestType->isIntegerType() &&
2117 (SrcType->isBooleanType() == DestType->isBooleanType()) &&
2118 (SrcType->isEnumeralType() == DestType->isEnumeralType()))
2120 if (SrcType->isRealFloatingType() && DestType->isRealFloatingType())
2122 if (SrcType->isEnumeralType() && DestType->isEnumeralType())
2124 if (SrcType->isComplexType() && DestType->isComplexType())
2126 if (SrcType->isComplexIntegerType() && DestType->isComplexIntegerType())
2131 << SrcType << DestType << SrcExpr.get()->getSourceRange();
2162 QualType SrcType = SrcExpr.get()->getType();
2164 assert(!SrcType->isPlaceholderType());
2175 if (DestRecordTy && Self.Context.hasSameUnqualifiedType(DestType, SrcType)){
2189 if (Self.Context.hasSameUnqualifiedType(Field->getType(), SrcType) &&
2198 << SrcType << SrcExpr.get()->getSourceRange();
2216 if (!SrcType->isScalarType() && !SrcType->isVectorType()) {
2219 << SrcType << SrcExpr.get()->getSourceRange();
2231 (SrcType->isIntegerType() || SrcType->isFloatingType())) {
2233 } else if (Self.CheckVectorCast(OpRange, DestType, SrcType, Kind)) {
2239 if (SrcType->isVectorType()) {
2240 if (Self.CheckVectorCast(OpRange, SrcType, DestType, Kind))
2259 if (!SrcType->isIntegralType(Self.Context) && SrcType->isArithmeticType()) {
2262 << SrcType << SrcExpr.get()->getSourceRange();
2268 } else if (!SrcType->isArithmeticType()) {
2295 if (const PointerType *ExprPtr = SrcType->getAs<PointerType>()) {
2303 << SrcType << DestType << Sema::AA_Casting
2309 else if (!Self.CheckObjCARCUnavailableWeakConversion(DestType, SrcType)) {
2312 << 1 << SrcType << DestType << SrcExpr.get()->getSourceRange();