Add CK_DerivedToBase and use it PerformObjectMemberConversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77652 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index f7fce85..84d7211 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -194,7 +194,8 @@
/// ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast.
/// If there is already an implicit cast, merge into the existing one.
/// If isLvalue, the result of the cast is an lvalue.
-void Sema::ImpCastExprToType(Expr *&Expr, QualType Ty, bool isLvalue) {
+void Sema::ImpCastExprToType(Expr *&Expr, QualType Ty,
+ CastExpr::CastKind Kind, bool isLvalue) {
QualType ExprTy = Context.getCanonicalType(Expr->getType());
QualType TypeTy = Context.getCanonicalType(Ty);
@@ -217,7 +218,7 @@
ImpCast->setType(Ty);
ImpCast->setLvalueCast(isLvalue);
} else
- Expr = new (Context) ImplicitCastExpr(Ty, CastExpr::CK_Unknown, Expr,
+ Expr = new (Context) ImplicitCastExpr(Ty, Kind, Expr,
isLvalue);
}