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()
691 SrcExpr = ExprError(); in CheckDynamicCast()
704 << SrcPointee.getUnqualifiedType() << SrcExpr.get()->getSourceRange(); in CheckDynamicCast()
705 SrcExpr = ExprError(); in CheckDynamicCast()
713 SrcExpr = ExprError(); in CheckDynamicCast()
728 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckConstCast()
730 SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get()); in CheckConstCast()
731 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckConstCast()
735 if (TryConstCast(Self, SrcExpr, DestType, /*CStyle*/false, msg) != TC_Success in CheckConstCast()
738 << SrcExpr.get()->getType() << DestType << OpRange; in CheckConstCast()
739 SrcExpr = ExprError(); in CheckConstCast()
745 static void DiagnoseReinterpretUpDownCast(Sema &Self, const Expr *SrcExpr, in DiagnoseReinterpretUpDownCast() argument
748 QualType SrcType = SrcExpr->getType(); in DiagnoseReinterpretUpDownCast()
843 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckReinterpretCast()
846 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckReinterpretCast()
851 TryReinterpretCast(Self, SrcExpr, DestType, in CheckReinterpretCast()
855 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckReinterpretCast()
857 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckReinterpretCast()
860 << OverloadExpr::find(SrcExpr.get()).Expression->getName() in CheckReinterpretCast()
862 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckReinterpretCast()
865 diagnoseBadCast(Self, msg, CT_Reinterpret, OpRange, SrcExpr.get(), in CheckReinterpretCast()
868 SrcExpr = ExprError(); in CheckReinterpretCast()
872 DiagnoseReinterpretUpDownCast(Self, SrcExpr.get(), DestType, OpRange); in CheckReinterpretCast()
883 if (SrcExpr.isInvalid()) in CheckStaticCast()
894 Self.ResolveAndFixSingleFunctionTemplateSpecialization(SrcExpr, in CheckStaticCast()
898 if (SrcExpr.isInvalid()) in CheckStaticCast()
902 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckStaticCast()
908 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckStaticCast()
909 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckStaticCast()
915 = TryStaticCast(Self, SrcExpr, DestType, Sema::CCK_OtherCast, OpRange, msg, in CheckStaticCast()
918 if (SrcExpr.isInvalid()) in CheckStaticCast()
920 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckStaticCast()
921 OverloadExpr* oe = OverloadExpr::find(SrcExpr.get()).Expression; in CheckStaticCast()
925 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckStaticCast()
927 diagnoseBadCast(Self, msg, CT_Static, OpRange, SrcExpr.get(), DestType, in CheckStaticCast()
930 SrcExpr = ExprError(); in CheckStaticCast()
944 static TryCastResult TryStaticCast(Sema &Self, ExprResult &SrcExpr, in TryStaticCast() argument
974 tcr = TryStaticReferenceDowncast(Self, SrcExpr.get(), DestType, CStyle, in TryStaticCast()
982 tcr = TryLValueToRValueCast(Self, SrcExpr.get(), DestType, CStyle, Kind, in TryStaticCast()
989 tcr = TryStaticImplicitCast(Self, SrcExpr, DestType, CCK, OpRange, msg, in TryStaticCast()
991 if (SrcExpr.isInvalid()) in TryStaticCast()
1004 QualType SrcType = Self.Context.getCanonicalType(SrcExpr.get()->getType()); in TryStaticCast()
1052 tcr = TryStaticMemberPointerUpcast(Self, SrcExpr, SrcType, DestType, CStyle, in TryStaticCast()
1117 Self.CheckTollFreeBridgeStaticCast(DestType, SrcExpr.get(), Kind)) in TryStaticCast()
1134 TryLValueToRValueCast(Sema &Self, Expr *SrcExpr, QualType DestType, in TryLValueToRValueCast() argument
1144 if (!SrcExpr->isGLValue()) in TryLValueToRValueCast()
1153 QualType FromType = SrcExpr->getType(); in TryLValueToRValueCast()
1160 if (Self.CompareReferenceRelationship(SrcExpr->getLocStart(), in TryLValueToRValueCast()
1175 if (!Self.IsDerivedFrom(SrcExpr->getLocStart(), SrcExpr->getType(), in TryLValueToRValueCast()
1188 TryStaticReferenceDowncast(Sema &Self, Expr *SrcExpr, QualType DestType, in TryStaticReferenceDowncast() argument
1206 if (!RValueRef && !SrcExpr->isLValue()) { in TryStaticReferenceDowncast()
1218 Self.Context.getCanonicalType(SrcExpr->getType()), in TryStaticReferenceDowncast()
1220 OpRange, SrcExpr->getType(), DestType, msg, Kind, in TryStaticReferenceDowncast()
1375 TryStaticMemberPointerUpcast(Sema &Self, ExprResult &SrcExpr, QualType SrcType, in TryStaticMemberPointerUpcast() argument
1386 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in TryStaticMemberPointerUpcast()
1388 = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), DestType, false, in TryStaticMemberPointerUpcast()
1464 FunctionDecl *Fn = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), in TryStaticMemberPointerUpcast()
1473 SrcExpr = Self.FixOverloadedFunctionReference(SrcExpr, FoundOverload, Fn); in TryStaticMemberPointerUpcast()
1474 if (!SrcExpr.isUsable()) { in TryStaticMemberPointerUpcast()
1491 TryStaticImplicitCast(Sema &Self, ExprResult &SrcExpr, QualType DestType, in TryStaticImplicitCast() argument
1513 Expr *SrcExprRaw = SrcExpr.get(); in TryStaticImplicitCast()
1537 SrcExpr = Result; in TryStaticImplicitCast()
1543 static TryCastResult TryConstCast(Sema &Self, ExprResult &SrcExpr, in TryConstCast() argument
1547 QualType SrcType = SrcExpr.get()->getType(); in TryConstCast()
1562 if (isa<LValueReferenceType>(DestTypeTmp) && !SrcExpr.get()->isLValue()) { in TryConstCast()
1570 if (isa<RValueReferenceType>(DestTypeTmp) && SrcExpr.get()->isRValue()) { in TryConstCast()
1588 if (SrcExpr.get()->refersToBitField()) { in TryConstCast()
1649 SrcExpr = new (Self.Context) MaterializeTemporaryExpr( in TryConstCast()
1650 SrcType, SrcExpr.get(), /*IsLValueReference*/ false); in TryConstCast()
1710 static void DiagnoseCastOfObjCSEL(Sema &Self, const ExprResult &SrcExpr, in DiagnoseCastOfObjCSEL() argument
1712 QualType SrcType = SrcExpr.get()->getType(); in DiagnoseCastOfObjCSEL()
1721 Self.Diag(SrcExpr.get()->getExprLoc(), in DiagnoseCastOfObjCSEL()
1723 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in DiagnoseCastOfObjCSEL()
1728 const Expr *SrcExpr, QualType DestType, in checkIntToPointerCast() argument
1730 QualType SrcType = SrcExpr->getType(); in checkIntToPointerCast()
1738 && !SrcExpr->isIntegerConstantExpr(Self.Context) in checkIntToPointerCast()
1753 static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr, in TryReinterpretCast() argument
1761 QualType SrcType = SrcExpr.get()->getType(); in TryReinterpretCast()
1769 ExprResult SingleFunctionExpr = SrcExpr; in TryReinterpretCast()
1774 SrcExpr = SingleFunctionExpr; in TryReinterpretCast()
1775 SrcType = SrcExpr.get()->getType(); in TryReinterpretCast()
1782 if (!SrcExpr.get()->isGLValue()) { in TryReinterpretCast()
1799 switch (SrcExpr.get()->getObjectKind()) { in TryReinterpretCast()
1811 << OpRange << SrcExpr.get()->getSourceRange(); in TryReinterpretCast()
1812 msg = 0; SrcExpr = ExprError(); in TryReinterpretCast()
1961 checkIntToPointerCast(CStyle, OpRange.getBegin(), SrcExpr.get(), DestType, in TryReinterpretCast()
1993 Kind = Self.PrepareCastToObjCObjectPointer(SrcExpr); in TryReinterpretCast()
2010 DiagnoseCastOfObjCSEL(Self, SrcExpr, DestType); in TryReinterpretCast()
2058 SrcExpr = Self.checkUnknownAnyCast(DestRange, DestType, in CheckCXXCStyleCast()
2059 SrcExpr.get(), Kind, in CheckCXXCStyleCast()
2065 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2077 SrcExpr, /* Decay Function to ptr */ false, in CheckCXXCStyleCast()
2080 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2084 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckCXXCStyleCast()
2089 if (DestType->isDependentType() || SrcExpr.get()->isTypeDependent() || in CheckCXXCStyleCast()
2090 SrcExpr.get()->isValueDependent()) { in CheckCXXCStyleCast()
2097 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckCXXCStyleCast()
2098 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2105 && (SrcExpr.get()->getType()->isIntegerType() in CheckCXXCStyleCast()
2106 || SrcExpr.get()->getType()->isFloatingType())) { in CheckCXXCStyleCast()
2123 TryCastResult tcr = TryConstCast(Self, SrcExpr, DestType, in CheckCXXCStyleCast()
2125 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2135 tcr = TryStaticCast(Self, SrcExpr, DestType, CCK, OpRange, in CheckCXXCStyleCast()
2137 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2142 tcr = TryReinterpretCast(Self, SrcExpr, DestType, /*CStyle*/true, in CheckCXXCStyleCast()
2144 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2153 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckCXXCStyleCast()
2155 FunctionDecl *Fn = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), in CheckCXXCStyleCast()
2163 OverloadExpr *OE = OverloadExpr::find(SrcExpr.get()).Expression; in CheckCXXCStyleCast()
2167 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckCXXCStyleCast()
2171 OpRange, SrcExpr.get(), DestType, ListInitialization); in CheckCXXCStyleCast()
2179 SrcExpr = ExprError(); in CheckCXXCStyleCast()
2185 static void DiagnoseBadFunctionCast(Sema &Self, const ExprResult &SrcExpr, in DiagnoseBadFunctionCast() argument
2188 SrcExpr.get()->getExprLoc())) in DiagnoseBadFunctionCast()
2191 if (!isa<CallExpr>(SrcExpr.get())) in DiagnoseBadFunctionCast()
2194 QualType SrcType = SrcExpr.get()->getType(); in DiagnoseBadFunctionCast()
2213 Self.Diag(SrcExpr.get()->getExprLoc(), in DiagnoseBadFunctionCast()
2215 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in DiagnoseBadFunctionCast()
2224 SrcExpr = Self.checkUnknownAnyCast(DestRange, DestType, in CheckCStyleCast()
2225 SrcExpr.get(), Kind, in CheckCStyleCast()
2234 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckCStyleCast()
2235 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2244 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckCStyleCast()
2247 SrcExpr.get(), DestType, /*Complain=*/true, DAP)) in CheckCStyleCast()
2248 SrcExpr = Self.FixOverloadedFunctionReference(SrcExpr.get(), DAP, FD); in CheckCStyleCast()
2251 assert(SrcExpr.isUsable()); in CheckCStyleCast()
2253 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckCStyleCast()
2254 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2256 QualType SrcType = SrcExpr.get()->getType(); in CheckCStyleCast()
2269 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2270 SrcExpr = ExprError(); in CheckCStyleCast()
2277 SrcExpr = ExprError(); in CheckCStyleCast()
2287 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2301 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2307 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2308 SrcExpr = ExprError(); in CheckCStyleCast()
2317 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2318 SrcExpr = ExprError(); in CheckCStyleCast()
2326 Self.Diag(SrcExpr.get()->getExprLoc(), in CheckCStyleCast()
2328 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2329 SrcExpr = ExprError(); in CheckCStyleCast()
2334 SrcExpr = Self.CheckExtVectorCast(OpRange, DestType, SrcExpr.get(), Kind); in CheckCStyleCast()
2343 SrcExpr = ExprError(); in CheckCStyleCast()
2350 SrcExpr = ExprError(); in CheckCStyleCast()
2359 if (isa<ObjCSelectorExpr>(SrcExpr.get())) { in CheckCStyleCast()
2360 Self.Diag(SrcExpr.get()->getExprLoc(), diag::err_cast_selector_expr); in CheckCStyleCast()
2361 SrcExpr = ExprError(); in CheckCStyleCast()
2369 Self.Diag(SrcExpr.get()->getExprLoc(), in CheckCStyleCast()
2371 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2372 SrcExpr = ExprError(); in CheckCStyleCast()
2375 checkIntToPointerCast(/* CStyle */ true, OpRange.getBegin(), SrcExpr.get(), in CheckCStyleCast()
2380 Self.Diag(SrcExpr.get()->getLocStart(), in CheckCStyleCast()
2382 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2383 SrcExpr = ExprError(); in CheckCStyleCast()
2390 Self.Diag(SrcExpr.get()->getLocStart(), diag::err_opencl_cast_to_half) in CheckCStyleCast()
2391 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2392 SrcExpr = ExprError(); in CheckCStyleCast()
2400 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2410 Self.Diag(SrcExpr.get()->getLocStart(), in CheckCStyleCast()
2413 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2419 Self.Diag(SrcExpr.get()->getLocStart(), in CheckCStyleCast()
2421 << 1 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2422 SrcExpr = ExprError(); in CheckCStyleCast()
2427 DiagnoseCastOfObjCSEL(Self, SrcExpr, DestType); in CheckCStyleCast()
2428 DiagnoseBadFunctionCast(Self, SrcExpr, DestType); in CheckCStyleCast()
2429 Kind = Self.PrepareScalarCast(SrcExpr, DestType); in CheckCStyleCast()
2430 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2453 Self.Diag(SrcExpr.get()->getLocStart(), diag::warn_cast_qual2) << in CheckCStyleCast()
2456 Self.Diag(SrcExpr.get()->getLocStart(), diag::warn_cast_qual) << in CheckCStyleCast()
2476 if (Op.SrcExpr.isInvalid()) in BuildCStyleCastExpr()
2480 Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCStyleCastExpr()
2494 if (Op.SrcExpr.isInvalid()) in BuildCXXFunctionalCastExpr()
2497 auto *SubExpr = Op.SrcExpr.get(); in BuildCXXFunctionalCastExpr()
2505 Op.SrcExpr.get(), &Op.BasePath, LPLoc, RPLoc)); in BuildCXXFunctionalCastExpr()