Lines Matching refs:SrcExpr
60 : Self(S), SrcExpr(src), DestType(destType), in CastOperation()
87 ExprResult SrcExpr; member
155 Self.CheckCastAlign(SrcExpr.get(), DestType, OpRange); in checkCastAlign()
161 Expr *src = SrcExpr.get(); in checkObjCConversion()
165 SrcExpr = src; in checkObjCConversion()
173 SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get()); in checkNonOverloadPlaceholders()
174 if (SrcExpr.isInvalid()) in checkNonOverloadPlaceholders()
196 if (!Op.SrcExpr.isInvalid()) in ~CheckNoDerefRAII()
197 CheckNoDeref(Op.Self, Op.SrcExpr.get()->getType(), Op.ResultType, in ~CheckNoDerefRAII()
205 static void DiagnoseCastQual(Sema &Self, const ExprResult &SrcExpr,
219 static TryCastResult TryLValueToRValueCast(Sema &Self, Expr *SrcExpr,
224 static TryCastResult TryStaticReferenceDowncast(Sema &Self, Expr *SrcExpr,
243 static TryCastResult TryStaticMemberPointerUpcast(Sema &Self, ExprResult &SrcExpr,
251 static TryCastResult TryStaticImplicitCast(Sema &Self, ExprResult &SrcExpr,
257 static TryCastResult TryStaticCast(Sema &Self, ExprResult &SrcExpr,
264 static TryCastResult TryConstCast(Sema &Self, ExprResult &SrcExpr,
267 static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr,
271 static TryCastResult TryAddressSpaceCast(Sema &Self, ExprResult &SrcExpr,
321 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
325 Context, Op.ResultType, Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCXXNamedCast()
331 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
336 Op.ValueKind, Op.SrcExpr.get(), DestTInfo, in BuildCXXNamedCast()
349 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
353 Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCXXNamedCast()
361 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
366 Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCXXNamedCast()
374 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
380 Context, Op.ResultType, Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCXXNamedCast()
409 if (Op.SrcExpr.isInvalid()) in BuildBuiltinBitCastExpr()
415 Op.SrcExpr.get(), TSI, KWLoc, RParenLoc); in BuildBuiltinBitCastExpr()
784 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckDynamicCast()
786 SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get()); in CheckDynamicCast()
787 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckDynamicCast()
790 QualType OrigSrcType = SrcExpr.get()->getType(); in CheckDynamicCast()
806 SrcExpr = ExprError(); in CheckDynamicCast()
817 SrcExpr = ExprError(); in CheckDynamicCast()
823 SrcExpr = ExprError(); in CheckDynamicCast()
838 << OrigSrcType << this->DestType << SrcExpr.get()->getSourceRange(); in CheckDynamicCast()
839 SrcExpr = ExprError(); in CheckDynamicCast()
843 if (!SrcExpr.get()->isLValue()) { in CheckDynamicCast()
851 if (SrcExpr.get()->isPRValue()) in CheckDynamicCast()
852 SrcExpr = Self.CreateMaterializeTemporaryExpr( in CheckDynamicCast()
853 SrcType, SrcExpr.get(), /*IsLValueReference*/ false); in CheckDynamicCast()
861 SrcExpr.get())) { in CheckDynamicCast()
862 SrcExpr = ExprError(); in CheckDynamicCast()
867 << SrcPointee.getUnqualifiedType() << SrcExpr.get()->getSourceRange(); in CheckDynamicCast()
868 SrcExpr = ExprError(); in CheckDynamicCast()
882 SrcExpr = ExprError(); in CheckDynamicCast()
900 SrcExpr = ExprError(); in CheckDynamicCast()
913 << SrcPointee.getUnqualifiedType() << SrcExpr.get()->getSourceRange(); in CheckDynamicCast()
914 SrcExpr = ExprError(); in CheckDynamicCast()
922 SrcExpr = ExprError(); in CheckDynamicCast()
959 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckConstCast()
961 SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get()); in CheckConstCast()
962 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckConstCast()
966 auto TCR = TryConstCast(Self, SrcExpr, DestType, /*CStyle*/ false, msg); in CheckConstCast()
969 << SrcExpr.get()->getType() << DestType << OpRange; in CheckConstCast()
972 SrcExpr = ExprError(); in CheckConstCast()
978 TryAddressSpaceCast(Self, SrcExpr, DestType, /*CStyle*/ false, msg, Kind); in CheckAddrspaceCast()
981 << CT_Addrspace << SrcExpr.get()->getType() << DestType << OpRange; in CheckAddrspaceCast()
984 SrcExpr = ExprError(); in CheckAddrspaceCast()
989 static void DiagnoseReinterpretUpDownCast(Sema &Self, const Expr *SrcExpr, in DiagnoseReinterpretUpDownCast() argument
992 QualType SrcType = SrcExpr->getType(); in DiagnoseReinterpretUpDownCast()
1094 static unsigned int checkCastFunctionType(Sema &Self, const ExprResult &SrcExpr, in checkCastFunctionType() argument
1100 if (!Self.Diags.isIgnored(ID, SrcExpr.get()->getExprLoc())) { in checkCastFunctionType()
1108 QualType SrcType = SrcExpr.get()->getType(); in checkCastFunctionType()
1186 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckReinterpretCast()
1189 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckReinterpretCast()
1194 TryReinterpretCast(Self, SrcExpr, DestType, in CheckReinterpretCast()
1197 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckReinterpretCast()
1199 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckReinterpretCast()
1202 << OverloadExpr::find(SrcExpr.get()).Expression->getName() in CheckReinterpretCast()
1204 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckReinterpretCast()
1207 diagnoseBadCast(Self, msg, CT_Reinterpret, OpRange, SrcExpr.get(), in CheckReinterpretCast()
1215 DiagnoseReinterpretUpDownCast(Self, SrcExpr.get(), DestType, OpRange); in CheckReinterpretCast()
1217 if (unsigned DiagID = checkCastFunctionType(Self, SrcExpr, DestType)) in CheckReinterpretCast()
1219 << SrcExpr.get()->getType() << DestType << OpRange; in CheckReinterpretCast()
1221 SrcExpr = ExprError(); in CheckReinterpretCast()
1234 if (SrcExpr.isInvalid()) in CheckStaticCast()
1245 Self.ResolveAndFixSingleFunctionTemplateSpecialization(SrcExpr, in CheckStaticCast()
1249 if (SrcExpr.isInvalid()) in CheckStaticCast()
1253 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckStaticCast()
1259 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckStaticCast()
1260 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckStaticCast()
1266 = TryStaticCast(Self, SrcExpr, DestType, Sema::CCK_OtherCast, OpRange, msg, in CheckStaticCast()
1269 if (SrcExpr.isInvalid()) in CheckStaticCast()
1271 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckStaticCast()
1272 OverloadExpr* oe = OverloadExpr::find(SrcExpr.get()).Expression; in CheckStaticCast()
1276 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckStaticCast()
1278 diagnoseBadCast(Self, msg, CT_Static, OpRange, SrcExpr.get(), DestType, in CheckStaticCast()
1289 SrcExpr = ExprError(); in CheckStaticCast()
1307 static TryCastResult TryStaticCast(Sema &Self, ExprResult &SrcExpr, in TryStaticCast() argument
1337 tcr = TryStaticReferenceDowncast(Self, SrcExpr.get(), DestType, CStyle, in TryStaticCast()
1345 tcr = TryLValueToRValueCast(Self, SrcExpr.get(), DestType, CStyle, Kind, in TryStaticCast()
1352 tcr = TryStaticImplicitCast(Self, SrcExpr, DestType, CCK, OpRange, msg, in TryStaticCast()
1354 if (SrcExpr.isInvalid()) in TryStaticCast()
1369 QualType SrcType = Self.Context.getCanonicalType(SrcExpr.get()->getType()); in TryStaticCast()
1400 SrcExpr = ExprError(); in TryStaticCast()
1428 tcr = TryStaticMemberPointerUpcast(Self, SrcExpr, SrcType, DestType, CStyle, in TryStaticCast()
1495 Self.CheckTollFreeBridgeStaticCast(DestType, SrcExpr.get(), Kind)) in TryStaticCast()
1508 SrcExpr = ExprError(); in TryStaticCast()
1519 TryCastResult TryLValueToRValueCast(Sema &Self, Expr *SrcExpr, in TryLValueToRValueCast() argument
1530 if (!SrcExpr->isGLValue()) in TryLValueToRValueCast()
1536 QualType FromType = SrcExpr->getType(); in TryLValueToRValueCast()
1545 SrcExpr->getBeginLoc(), ToType, FromType, &RefConv); in TryLValueToRValueCast()
1552 msg = SrcExpr->isLValue() ? diag::err_bad_lvalue_to_rvalue_cast in TryLValueToRValueCast()
1561 if (!Self.IsDerivedFrom(SrcExpr->getBeginLoc(), SrcExpr->getType(), in TryLValueToRValueCast()
1574 TryStaticReferenceDowncast(Sema &Self, Expr *SrcExpr, QualType DestType, in TryStaticReferenceDowncast() argument
1592 if (!RValueRef && !SrcExpr->isLValue()) { in TryStaticReferenceDowncast()
1604 Self.Context.getCanonicalType(SrcExpr->getType()), in TryStaticReferenceDowncast()
1606 OpRange, SrcExpr->getType(), DestType, msg, Kind, in TryStaticReferenceDowncast()
1758 TryStaticMemberPointerUpcast(Sema &Self, ExprResult &SrcExpr, QualType SrcType, in TryStaticMemberPointerUpcast() argument
1769 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in TryStaticMemberPointerUpcast()
1771 = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), DestType, false, in TryStaticMemberPointerUpcast()
1849 FunctionDecl *Fn = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), in TryStaticMemberPointerUpcast()
1858 SrcExpr = Self.FixOverloadedFunctionReference(SrcExpr, FoundOverload, Fn); in TryStaticMemberPointerUpcast()
1859 if (!SrcExpr.isUsable()) { in TryStaticMemberPointerUpcast()
1876 TryStaticImplicitCast(Sema &Self, ExprResult &SrcExpr, QualType DestType, in TryStaticImplicitCast() argument
1898 Expr *SrcExprRaw = SrcExpr.get(); in TryStaticImplicitCast()
1925 SrcExpr = Result; in TryStaticImplicitCast()
1931 static TryCastResult TryConstCast(Sema &Self, ExprResult &SrcExpr, in TryConstCast() argument
1935 QualType SrcType = SrcExpr.get()->getType(); in TryConstCast()
1950 if (isa<LValueReferenceType>(DestTypeTmp) && !SrcExpr.get()->isLValue()) { in TryConstCast()
1958 if (isa<RValueReferenceType>(DestTypeTmp) && SrcExpr.get()->isPRValue()) { in TryConstCast()
1976 if (SrcExpr.get()->refersToBitField()) { in TryConstCast()
2022 SrcExpr = Self.CreateMaterializeTemporaryExpr(SrcExpr.get()->getType(), in TryConstCast()
2023 SrcExpr.get(), in TryConstCast()
2084 static void DiagnoseCastOfObjCSEL(Sema &Self, const ExprResult &SrcExpr, in DiagnoseCastOfObjCSEL() argument
2086 QualType SrcType = SrcExpr.get()->getType(); in DiagnoseCastOfObjCSEL()
2095 Self.Diag(SrcExpr.get()->getExprLoc(), in DiagnoseCastOfObjCSEL()
2097 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in DiagnoseCastOfObjCSEL()
2103 static void DiagnoseCallingConvCast(Sema &Self, const ExprResult &SrcExpr, in DiagnoseCallingConvCast() argument
2107 QualType SrcType = SrcExpr.get()->getType(); in DiagnoseCallingConvCast()
2122 Expr *Src = SrcExpr.get()->IgnoreParenImpCasts(); in DiagnoseCallingConvCast()
2192 const Expr *SrcExpr, QualType DestType, in checkIntToPointerCast() argument
2194 QualType SrcType = SrcExpr->getType(); in checkIntToPointerCast()
2202 && !SrcExpr->isIntegerConstantExpr(Self.Context) in checkIntToPointerCast()
2245 static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr, in TryReinterpretCast() argument
2253 QualType SrcType = SrcExpr.get()->getType(); in TryReinterpretCast()
2258 ExprResult FixedExpr = SrcExpr; in TryReinterpretCast()
2263 SrcExpr = FixedExpr; in TryReinterpretCast()
2264 SrcType = SrcExpr.get()->getType(); in TryReinterpretCast()
2268 if (!SrcExpr.get()->isGLValue()) { in TryReinterpretCast()
2285 switch (SrcExpr.get()->getObjectKind()) { in TryReinterpretCast()
2303 << OpRange << SrcExpr.get()->getSourceRange(); in TryReinterpretCast()
2304 msg = 0; SrcExpr = ExprError(); in TryReinterpretCast()
2480 checkIntToPointerCast(CStyle, OpRange, SrcExpr.get(), DestType, Self); in TryReinterpretCast()
2519 Kind = Self.PrepareCastToObjCObjectPointer(SrcExpr); in TryReinterpretCast()
2536 DiagnoseCastOfObjCSEL(Self, SrcExpr, DestType); in TryReinterpretCast()
2538 DiagnoseCallingConvCast(Self, SrcExpr, DestType, OpRange); in TryReinterpretCast()
2583 << CStyle << SrcType << DestType << SrcExpr.get()->getSourceRange(); in TryReinterpretCast()
2598 static TryCastResult TryAddressSpaceCast(Sema &Self, ExprResult &SrcExpr, in TryAddressSpaceCast() argument
2608 auto SrcType = SrcExpr.get()->getType(); in TryAddressSpaceCast()
2668 << SrcExpr.get()->getSourceRange(); in checkAddressSpaceCast()
2670 SrcExpr = ExprError(); in checkAddressSpaceCast()
2716 SrcExpr = Self.checkUnknownAnyCast(DestRange, DestType, in CheckCXXCStyleCast()
2717 SrcExpr.get(), Kind, in CheckCXXCStyleCast()
2723 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2735 SrcExpr, /* Decay Function to ptr */ false, in CheckCXXCStyleCast()
2738 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2742 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckCXXCStyleCast()
2747 if (DestType->isDependentType() || SrcExpr.get()->isTypeDependent() || in CheckCXXCStyleCast()
2748 SrcExpr.get()->isValueDependent()) { in CheckCXXCStyleCast()
2755 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckCXXCStyleCast()
2756 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2763 SrcExpr.get()->getType())) { in CheckCXXCStyleCast()
2764 SrcExpr = ExprError(); in CheckCXXCStyleCast()
2768 (SrcExpr.get()->getType()->isIntegerType() || in CheckCXXCStyleCast()
2769 SrcExpr.get()->getType()->isFloatingType())) { in CheckCXXCStyleCast()
2771 SrcExpr = Self.prepareVectorSplat(DestType, SrcExpr.get()); in CheckCXXCStyleCast()
2777 QualType SrcType = SrcExpr.get()->getType(); in CheckCXXCStyleCast()
2780 << 1 << SrcExpr.get()->getSourceRange(); in CheckCXXCStyleCast()
2781 SrcExpr = ExprError(); in CheckCXXCStyleCast()
2798 TryCastResult tcr = TryConstCast(Self, SrcExpr, DestType, in CheckCXXCStyleCast()
2800 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2808 tcr = TryAddressSpaceCast(Self, SrcExpr, DestType, /*CStyle*/ true, msg, in CheckCXXCStyleCast()
2810 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2816 tcr = TryStaticCast(Self, SrcExpr, DestType, CCK, OpRange, msg, Kind, in CheckCXXCStyleCast()
2818 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2823 tcr = TryReinterpretCast(Self, SrcExpr, DestType, /*CStyle*/ true, in CheckCXXCStyleCast()
2825 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2836 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckCXXCStyleCast()
2838 FunctionDecl *Fn = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), in CheckCXXCStyleCast()
2846 OverloadExpr *OE = OverloadExpr::find(SrcExpr.get()).Expression; in CheckCXXCStyleCast()
2850 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckCXXCStyleCast()
2854 OpRange, SrcExpr.get(), DestType, ListInitialization); in CheckCXXCStyleCast()
2862 if (unsigned DiagID = checkCastFunctionType(Self, SrcExpr, DestType)) in CheckCXXCStyleCast()
2864 << SrcExpr.get()->getType() << DestType << OpRange; in CheckCXXCStyleCast()
2867 SrcExpr = ExprError(); in CheckCXXCStyleCast()
2874 static void DiagnoseBadFunctionCast(Sema &Self, const ExprResult &SrcExpr, in DiagnoseBadFunctionCast() argument
2877 SrcExpr.get()->getExprLoc())) in DiagnoseBadFunctionCast()
2880 if (!isa<CallExpr>(SrcExpr.get())) in DiagnoseBadFunctionCast()
2883 QualType SrcType = SrcExpr.get()->getType(); in DiagnoseBadFunctionCast()
2904 Self.Diag(SrcExpr.get()->getExprLoc(), in DiagnoseBadFunctionCast()
2906 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in DiagnoseBadFunctionCast()
2915 SrcExpr = Self.checkUnknownAnyCast(DestRange, DestType, in CheckCStyleCast()
2916 SrcExpr.get(), Kind, in CheckCStyleCast()
2925 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckCStyleCast()
2926 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2936 (DestType->isDependentType() || SrcExpr.get()->isTypeDependent() || in CheckCStyleCast()
2937 SrcExpr.get()->isValueDependent())) { in CheckCStyleCast()
2938 assert((DestType->containsErrors() || SrcExpr.get()->containsErrors() || in CheckCStyleCast()
2939 SrcExpr.get()->containsErrors()) && in CheckCStyleCast()
2946 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckCStyleCast()
2949 SrcExpr.get(), DestType, /*Complain=*/true, DAP)) in CheckCStyleCast()
2950 SrcExpr = Self.FixOverloadedFunctionReference(SrcExpr.get(), DAP, FD); in CheckCStyleCast()
2953 assert(SrcExpr.isUsable()); in CheckCStyleCast()
2955 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckCStyleCast()
2956 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2958 QualType SrcType = SrcExpr.get()->getType(); in CheckCStyleCast()
2962 << 1 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2963 SrcExpr = ExprError(); in CheckCStyleCast()
2970 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2975 SrcExpr = ExprError(); in CheckCStyleCast()
3007 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
3017 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
3022 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
3023 SrcExpr = ExprError(); in CheckCStyleCast()
3031 if (SrcExpr.get()->EvaluateAsInt(Result, Self.Context)) { in CheckCStyleCast()
3039 << toString(CastInt, 10) << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
3040 SrcExpr = ExprError(); in CheckCStyleCast()
3047 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
3048 SrcExpr = ExprError(); in CheckCStyleCast()
3057 Self.Diag(SrcExpr.get()->getExprLoc(), in CheckCStyleCast()
3059 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
3060 SrcExpr = ExprError(); in CheckCStyleCast()
3074 Self.Diag(SrcExpr.get()->getExprLoc(), diag::err_nullptr_cast) in CheckCStyleCast()
3076 SrcExpr = ExprError(); in CheckCStyleCast()
3083 SrcExpr = ImplicitCastExpr::Create(Self.Context, DestType, CK, in CheckCStyleCast()
3084 SrcExpr.get(), nullptr, VK_PRValue, in CheckCStyleCast()
3089 Self.Diag(SrcExpr.get()->getExprLoc(), diag::err_nullptr_cast) in CheckCStyleCast()
3091 SrcExpr = ExprError(); in CheckCStyleCast()
3096 SrcExpr = Self.CheckExtVectorCast(OpRange, DestType, SrcExpr.get(), Kind); in CheckCStyleCast()
3102 SrcExpr = ExprError(); in CheckCStyleCast()
3108 SrcExpr = ExprError(); in CheckCStyleCast()
3114 SrcExpr = Self.prepareVectorSplat(DestType, SrcExpr.get()); in CheckCStyleCast()
3116 SrcExpr = ExprError(); in CheckCStyleCast()
3123 SrcExpr = ExprError(); in CheckCStyleCast()
3132 if (isa<ObjCSelectorExpr>(SrcExpr.get())) { in CheckCStyleCast()
3133 Self.Diag(SrcExpr.get()->getExprLoc(), diag::err_cast_selector_expr); in CheckCStyleCast()
3134 SrcExpr = ExprError(); in CheckCStyleCast()
3142 Self.Diag(SrcExpr.get()->getExprLoc(), in CheckCStyleCast()
3144 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
3145 SrcExpr = ExprError(); in CheckCStyleCast()
3148 checkIntToPointerCast(/* CStyle */ true, OpRange, SrcExpr.get(), DestType, in CheckCStyleCast()
3153 Self.Diag(SrcExpr.get()->getBeginLoc(), in CheckCStyleCast()
3155 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
3156 SrcExpr = ExprError(); in CheckCStyleCast()
3183 Self.Diag(SrcExpr.get()->getBeginLoc(), diag::err_opencl_cast_to_half) in CheckCStyleCast()
3184 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
3185 SrcExpr = ExprError(); in CheckCStyleCast()
3193 if (SrcExpr.isInvalid()) in CheckCStyleCast()
3204 Self.Diag(SrcExpr.get()->getBeginLoc(), in CheckCStyleCast()
3207 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
3213 Self.Diag(SrcExpr.get()->getBeginLoc(), in CheckCStyleCast()
3215 << 1 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
3216 SrcExpr = ExprError(); in CheckCStyleCast()
3221 if (unsigned DiagID = checkCastFunctionType(Self, SrcExpr, DestType)) in CheckCStyleCast()
3236 SrcExpr = ExprError(); in CheckCStyleCast()
3241 DiagnoseCastOfObjCSEL(Self, SrcExpr, DestType); in CheckCStyleCast()
3242 DiagnoseCallingConvCast(Self, SrcExpr, DestType, OpRange); in CheckCStyleCast()
3243 DiagnoseBadFunctionCast(Self, SrcExpr, DestType); in CheckCStyleCast()
3244 Kind = Self.PrepareScalarCast(SrcExpr, DestType); in CheckCStyleCast()
3245 if (SrcExpr.isInvalid()) in CheckCStyleCast()
3253 QualType SrcType = SrcExpr.get()->getType(); in CheckBuiltinBitCast()
3259 SrcExpr = ExprError(); in CheckBuiltinBitCast()
3263 if (SrcExpr.get()->isPRValue()) in CheckBuiltinBitCast()
3264 SrcExpr = Self.CreateMaterializeTemporaryExpr(SrcType, SrcExpr.get(), in CheckBuiltinBitCast()
3272 SrcExpr = ExprError(); in CheckBuiltinBitCast()
3279 SrcExpr = ExprError(); in CheckBuiltinBitCast()
3286 SrcExpr = ExprError(); in CheckBuiltinBitCast()
3295 static void DiagnoseCastQual(Sema &Self, const ExprResult &SrcExpr, in DiagnoseCastQual() argument
3297 if (SrcExpr.isInvalid()) in DiagnoseCastQual()
3300 QualType SrcType = SrcExpr.get()->getType(); in DiagnoseCastQual()
3324 Self.Diag(SrcExpr.get()->getBeginLoc(), diag::warn_cast_qual2) in DiagnoseCastQual()
3327 Self.Diag(SrcExpr.get()->getBeginLoc(), diag::warn_cast_qual) in DiagnoseCastQual()
3346 if (Op.SrcExpr.isInvalid()) in BuildCStyleCastExpr()
3350 DiagnoseCastQual(Op.Self, Op.SrcExpr, Op.DestType); in BuildCStyleCastExpr()
3353 Context, Op.ResultType, Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCStyleCastExpr()
3368 if (Op.SrcExpr.isInvalid()) in BuildCXXFunctionalCastExpr()
3371 auto *SubExpr = Op.SrcExpr.get(); in BuildCXXFunctionalCastExpr()
3378 DiagnoseCastQual(Op.Self, Op.SrcExpr, Op.DestType); in BuildCXXFunctionalCastExpr()
3382 Op.SrcExpr.get(), &Op.BasePath, CurFPFeatureOverrides(), LPLoc, RPLoc)); in BuildCXXFunctionalCastExpr()