Lines Matching refs:SrcExpr

51       : Self(S), SrcExpr(src), DestType(destType),  in CastOperation()
65 ExprResult SrcExpr; member
119 Self.CheckCastAlign(SrcExpr.get(), DestType, OpRange); in checkCastAlign()
125 Expr *src = SrcExpr.get(); in checkObjCARCConversion()
129 SrcExpr = src; in checkObjCARCConversion()
137 SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get()); in checkNonOverloadPlaceholders()
138 if (SrcExpr.isInvalid()) in checkNonOverloadPlaceholders()
156 static TryCastResult TryLValueToRValueCast(Sema &Self, Expr *SrcExpr,
161 static TryCastResult TryStaticReferenceDowncast(Sema &Self, Expr *SrcExpr,
180 static TryCastResult TryStaticMemberPointerUpcast(Sema &Self, ExprResult &SrcExpr,
188 static TryCastResult TryStaticImplicitCast(Sema &Self, ExprResult &SrcExpr,
194 static TryCastResult TryStaticCast(Sema &Self, ExprResult &SrcExpr,
201 static TryCastResult TryConstCast(Sema &Self, ExprResult &SrcExpr,
204 static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr,
256 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
260 Op.ValueKind, Op.SrcExpr.get(), DestTInfo, in BuildCXXNamedCast()
267 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
271 Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCXXNamedCast()
279 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
283 Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCXXNamedCast()
291 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
296 Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCXXNamedCast()
575 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckDynamicCast()
577 SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get()); in CheckDynamicCast()
578 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckDynamicCast()
581 QualType OrigSrcType = SrcExpr.get()->getType(); in CheckDynamicCast()
597 SrcExpr = ExprError(); in CheckDynamicCast()
608 SrcExpr = ExprError(); in CheckDynamicCast()
614 SrcExpr = ExprError(); in CheckDynamicCast()
629 << OrigSrcType << SrcExpr.get()->getSourceRange(); in CheckDynamicCast()
630 SrcExpr = ExprError(); in CheckDynamicCast()
634 if (!SrcExpr.get()->isLValue()) { in CheckDynamicCast()
642 if (SrcExpr.get()->isRValue()) in CheckDynamicCast()
643 SrcExpr = new (Self.Context) MaterializeTemporaryExpr( in CheckDynamicCast()
644 SrcType, SrcExpr.get(), /*IsLValueReference*/false); in CheckDynamicCast()
652 SrcExpr.get())) { in CheckDynamicCast()
653 SrcExpr = ExprError(); in CheckDynamicCast()
658 << SrcPointee.getUnqualifiedType() << SrcExpr.get()->getSourceRange(); in CheckDynamicCast()
659 SrcExpr = ExprError(); in CheckDynamicCast()
673 SrcExpr = ExprError(); in CheckDynamicCast()
690 SrcExpr = ExprError(); in CheckDynamicCast()
703 << SrcPointee.getUnqualifiedType() << SrcExpr.get()->getSourceRange(); in CheckDynamicCast()
704 SrcExpr = ExprError(); in CheckDynamicCast()
712 SrcExpr = ExprError(); in CheckDynamicCast()
727 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckConstCast()
729 SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get()); in CheckConstCast()
730 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckConstCast()
734 if (TryConstCast(Self, SrcExpr, DestType, /*CStyle*/false, msg) != TC_Success in CheckConstCast()
737 << SrcExpr.get()->getType() << DestType << OpRange; in CheckConstCast()
738 SrcExpr = ExprError(); in CheckConstCast()
744 static void DiagnoseReinterpretUpDownCast(Sema &Self, const Expr *SrcExpr, in DiagnoseReinterpretUpDownCast() argument
747 QualType SrcType = SrcExpr->getType(); in DiagnoseReinterpretUpDownCast()
842 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckReinterpretCast()
845 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckReinterpretCast()
850 TryReinterpretCast(Self, SrcExpr, DestType, in CheckReinterpretCast()
854 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckReinterpretCast()
856 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckReinterpretCast()
859 << OverloadExpr::find(SrcExpr.get()).Expression->getName() in CheckReinterpretCast()
861 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckReinterpretCast()
864 diagnoseBadCast(Self, msg, CT_Reinterpret, OpRange, SrcExpr.get(), in CheckReinterpretCast()
867 SrcExpr = ExprError(); in CheckReinterpretCast()
871 DiagnoseReinterpretUpDownCast(Self, SrcExpr.get(), DestType, OpRange); in CheckReinterpretCast()
882 if (SrcExpr.isInvalid()) in CheckStaticCast()
893 Self.ResolveAndFixSingleFunctionTemplateSpecialization(SrcExpr, in CheckStaticCast()
897 if (SrcExpr.isInvalid()) in CheckStaticCast()
901 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckStaticCast()
907 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckStaticCast()
908 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckStaticCast()
914 = TryStaticCast(Self, SrcExpr, DestType, Sema::CCK_OtherCast, OpRange, msg, in CheckStaticCast()
917 if (SrcExpr.isInvalid()) in CheckStaticCast()
919 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckStaticCast()
920 OverloadExpr* oe = OverloadExpr::find(SrcExpr.get()).Expression; in CheckStaticCast()
924 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckStaticCast()
926 diagnoseBadCast(Self, msg, CT_Static, OpRange, SrcExpr.get(), DestType, in CheckStaticCast()
929 SrcExpr = ExprError(); in CheckStaticCast()
943 static TryCastResult TryStaticCast(Sema &Self, ExprResult &SrcExpr, in TryStaticCast() argument
973 tcr = TryStaticReferenceDowncast(Self, SrcExpr.get(), DestType, CStyle, in TryStaticCast()
981 tcr = TryLValueToRValueCast(Self, SrcExpr.get(), DestType, CStyle, Kind, in TryStaticCast()
988 tcr = TryStaticImplicitCast(Self, SrcExpr, DestType, CCK, OpRange, msg, in TryStaticCast()
990 if (SrcExpr.isInvalid()) in TryStaticCast()
1003 QualType SrcType = Self.Context.getCanonicalType(SrcExpr.get()->getType()); in TryStaticCast()
1051 tcr = TryStaticMemberPointerUpcast(Self, SrcExpr, SrcType, DestType, CStyle, in TryStaticCast()
1107 Self.CheckTollFreeBridgeStaticCast(DestType, SrcExpr.get(), Kind)) in TryStaticCast()
1124 TryLValueToRValueCast(Sema &Self, Expr *SrcExpr, QualType DestType, in TryLValueToRValueCast() argument
1134 if (!SrcExpr->isGLValue()) in TryLValueToRValueCast()
1143 QualType FromType = SrcExpr->getType(); in TryLValueToRValueCast()
1150 if (Self.CompareReferenceRelationship(SrcExpr->getLocStart(), in TryLValueToRValueCast()
1163 if (!Self.IsDerivedFrom(SrcExpr->getType(), R->getPointeeType(), Paths)) in TryLValueToRValueCast()
1175 TryStaticReferenceDowncast(Sema &Self, Expr *SrcExpr, QualType DestType, in TryStaticReferenceDowncast() argument
1193 if (!RValueRef && !SrcExpr->isLValue()) { in TryStaticReferenceDowncast()
1205 Self.Context.getCanonicalType(SrcExpr->getType()), in TryStaticReferenceDowncast()
1207 OpRange, SrcExpr->getType(), DestType, msg, Kind, in TryStaticReferenceDowncast()
1362 TryStaticMemberPointerUpcast(Sema &Self, ExprResult &SrcExpr, QualType SrcType, in TryStaticMemberPointerUpcast() argument
1373 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in TryStaticMemberPointerUpcast()
1375 = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), DestType, false, in TryStaticMemberPointerUpcast()
1447 FunctionDecl *Fn = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), in TryStaticMemberPointerUpcast()
1456 SrcExpr = Self.FixOverloadedFunctionReference(SrcExpr, FoundOverload, Fn); in TryStaticMemberPointerUpcast()
1457 if (!SrcExpr.isUsable()) { in TryStaticMemberPointerUpcast()
1474 TryStaticImplicitCast(Sema &Self, ExprResult &SrcExpr, QualType DestType, in TryStaticImplicitCast() argument
1500 Expr *SrcExprRaw = SrcExpr.get(); in TryStaticImplicitCast()
1524 SrcExpr = Result; in TryStaticImplicitCast()
1530 static TryCastResult TryConstCast(Sema &Self, ExprResult &SrcExpr, in TryConstCast() argument
1534 QualType SrcType = SrcExpr.get()->getType(); in TryConstCast()
1549 if (isa<LValueReferenceType>(DestTypeTmp) && !SrcExpr.get()->isLValue()) { in TryConstCast()
1557 if (isa<RValueReferenceType>(DestTypeTmp) && SrcExpr.get()->isRValue()) { in TryConstCast()
1575 if (SrcExpr.get()->refersToBitField()) { in TryConstCast()
1636 SrcExpr = new (Self.Context) MaterializeTemporaryExpr( in TryConstCast()
1637 SrcType, SrcExpr.get(), /*IsLValueReference*/ false); in TryConstCast()
1697 static void DiagnoseCastOfObjCSEL(Sema &Self, const ExprResult &SrcExpr, in DiagnoseCastOfObjCSEL() argument
1699 QualType SrcType = SrcExpr.get()->getType(); in DiagnoseCastOfObjCSEL()
1708 Self.Diag(SrcExpr.get()->getExprLoc(), in DiagnoseCastOfObjCSEL()
1710 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in DiagnoseCastOfObjCSEL()
1715 const Expr *SrcExpr, QualType DestType, in checkIntToPointerCast() argument
1717 QualType SrcType = SrcExpr->getType(); in checkIntToPointerCast()
1725 && !SrcExpr->isIntegerConstantExpr(Self.Context) in checkIntToPointerCast()
1740 static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr, in TryReinterpretCast() argument
1748 QualType SrcType = SrcExpr.get()->getType(); in TryReinterpretCast()
1756 ExprResult SingleFunctionExpr = SrcExpr; in TryReinterpretCast()
1761 SrcExpr = SingleFunctionExpr; in TryReinterpretCast()
1762 SrcType = SrcExpr.get()->getType(); in TryReinterpretCast()
1769 if (!SrcExpr.get()->isGLValue()) { in TryReinterpretCast()
1786 switch (SrcExpr.get()->getObjectKind()) { in TryReinterpretCast()
1798 << OpRange << SrcExpr.get()->getSourceRange(); in TryReinterpretCast()
1799 msg = 0; SrcExpr = ExprError(); in TryReinterpretCast()
1947 checkIntToPointerCast(CStyle, OpRange.getBegin(), SrcExpr.get(), DestType, in TryReinterpretCast()
1979 Kind = Self.PrepareCastToObjCObjectPointer(SrcExpr); in TryReinterpretCast()
1996 DiagnoseCastOfObjCSEL(Self, SrcExpr, DestType); in TryReinterpretCast()
2044 SrcExpr = Self.checkUnknownAnyCast(DestRange, DestType, in CheckCXXCStyleCast()
2045 SrcExpr.get(), Kind, in CheckCXXCStyleCast()
2051 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2063 SrcExpr, /* Decay Function to ptr */ false, in CheckCXXCStyleCast()
2066 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2070 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckCXXCStyleCast()
2075 if (DestType->isDependentType() || SrcExpr.get()->isTypeDependent() || in CheckCXXCStyleCast()
2076 SrcExpr.get()->isValueDependent()) { in CheckCXXCStyleCast()
2083 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckCXXCStyleCast()
2084 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2091 && (SrcExpr.get()->getType()->isIntegerType() in CheckCXXCStyleCast()
2092 || SrcExpr.get()->getType()->isFloatingType())) { in CheckCXXCStyleCast()
2109 TryCastResult tcr = TryConstCast(Self, SrcExpr, DestType, in CheckCXXCStyleCast()
2111 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2121 tcr = TryStaticCast(Self, SrcExpr, DestType, CCK, OpRange, in CheckCXXCStyleCast()
2123 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2128 tcr = TryReinterpretCast(Self, SrcExpr, DestType, /*CStyle*/true, in CheckCXXCStyleCast()
2130 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2139 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckCXXCStyleCast()
2141 FunctionDecl *Fn = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), in CheckCXXCStyleCast()
2149 OverloadExpr *OE = OverloadExpr::find(SrcExpr.get()).Expression; in CheckCXXCStyleCast()
2153 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckCXXCStyleCast()
2157 OpRange, SrcExpr.get(), DestType, ListInitialization); in CheckCXXCStyleCast()
2165 SrcExpr = ExprError(); in CheckCXXCStyleCast()
2171 static void DiagnoseBadFunctionCast(Sema &Self, const ExprResult &SrcExpr, in DiagnoseBadFunctionCast() argument
2174 SrcExpr.get()->getExprLoc())) in DiagnoseBadFunctionCast()
2177 if (!isa<CallExpr>(SrcExpr.get())) in DiagnoseBadFunctionCast()
2180 QualType SrcType = SrcExpr.get()->getType(); in DiagnoseBadFunctionCast()
2199 Self.Diag(SrcExpr.get()->getExprLoc(), in DiagnoseBadFunctionCast()
2201 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in DiagnoseBadFunctionCast()
2210 SrcExpr = Self.checkUnknownAnyCast(DestRange, DestType, in CheckCStyleCast()
2211 SrcExpr.get(), Kind, in CheckCStyleCast()
2220 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckCStyleCast()
2221 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2229 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckCStyleCast()
2230 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2232 QualType SrcType = SrcExpr.get()->getType(); in CheckCStyleCast()
2245 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2246 SrcExpr = ExprError(); in CheckCStyleCast()
2253 SrcExpr = ExprError(); in CheckCStyleCast()
2263 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2277 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2283 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2284 SrcExpr = ExprError(); in CheckCStyleCast()
2293 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2294 SrcExpr = ExprError(); in CheckCStyleCast()
2302 Self.Diag(SrcExpr.get()->getExprLoc(), in CheckCStyleCast()
2304 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2305 SrcExpr = ExprError(); in CheckCStyleCast()
2310 SrcExpr = Self.CheckExtVectorCast(OpRange, DestType, SrcExpr.get(), Kind); in CheckCStyleCast()
2319 SrcExpr = ExprError(); in CheckCStyleCast()
2326 SrcExpr = ExprError(); in CheckCStyleCast()
2335 if (isa<ObjCSelectorExpr>(SrcExpr.get())) { in CheckCStyleCast()
2336 Self.Diag(SrcExpr.get()->getExprLoc(), diag::err_cast_selector_expr); in CheckCStyleCast()
2337 SrcExpr = ExprError(); in CheckCStyleCast()
2345 Self.Diag(SrcExpr.get()->getExprLoc(), in CheckCStyleCast()
2347 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2348 SrcExpr = ExprError(); in CheckCStyleCast()
2351 checkIntToPointerCast(/* CStyle */ true, OpRange.getBegin(), SrcExpr.get(), in CheckCStyleCast()
2356 Self.Diag(SrcExpr.get()->getLocStart(), in CheckCStyleCast()
2358 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2359 SrcExpr = ExprError(); in CheckCStyleCast()
2366 Self.Diag(SrcExpr.get()->getLocStart(), diag::err_opencl_cast_to_half) in CheckCStyleCast()
2367 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2368 SrcExpr = ExprError(); in CheckCStyleCast()
2376 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2386 Self.Diag(SrcExpr.get()->getLocStart(), in CheckCStyleCast()
2389 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2395 Self.Diag(SrcExpr.get()->getLocStart(), in CheckCStyleCast()
2397 << 1 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2398 SrcExpr = ExprError(); in CheckCStyleCast()
2403 DiagnoseCastOfObjCSEL(Self, SrcExpr, DestType); in CheckCStyleCast()
2404 DiagnoseBadFunctionCast(Self, SrcExpr, DestType); in CheckCStyleCast()
2405 Kind = Self.PrepareScalarCast(SrcExpr, DestType); in CheckCStyleCast()
2406 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2429 Self.Diag(SrcExpr.get()->getLocStart(), diag::warn_cast_qual2) << in CheckCStyleCast()
2432 Self.Diag(SrcExpr.get()->getLocStart(), diag::warn_cast_qual) << in CheckCStyleCast()
2452 if (Op.SrcExpr.isInvalid()) in BuildCStyleCastExpr()
2456 Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCStyleCastExpr()
2470 if (Op.SrcExpr.isInvalid()) in BuildCXXFunctionalCastExpr()
2473 if (CXXConstructExpr *ConstructExpr = dyn_cast<CXXConstructExpr>(Op.SrcExpr.get())) in BuildCXXFunctionalCastExpr()
2478 Op.SrcExpr.get(), &Op.BasePath, LPLoc, RPLoc)); in BuildCXXFunctionalCastExpr()