diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-24 17:30:16 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-24 17:30:16 +0000 |
commit | 745da3a5bb4ea35f93f50301e7fbbb7d78d3b6bb (patch) | |
tree | d2de835a949cf37da086500c49d5421662dea3c5 /lib/Sema/SemaExpr.cpp | |
parent | 51c7a789b17d708617946d5f9fde0a2e4feaefd1 (diff) |
Patch implements passing arrays to functions expecting
vla. Implements pr7827.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 51ef01fce8..c22b5e5bb6 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -3435,7 +3435,7 @@ ExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc, // Check the expression as an initializer for the parameter. InitializedEntity Entity - = InitializedEntity::InitializeParameter(Param); + = InitializedEntity::InitializeParameter(Context, Param); InitializationKind Kind = InitializationKind::CreateCopy(Param->getLocation(), /*FIXME:EqualLoc*/UninstExpr->getSourceRange().getBegin()); @@ -3564,10 +3564,9 @@ bool Sema::GatherArgumentsForCall(SourceLocation CallLoc, if (FDecl && i < FDecl->getNumParams()) Param = FDecl->getParamDecl(i); - InitializedEntity Entity = - Param? InitializedEntity::InitializeParameter(Param) - : InitializedEntity::InitializeParameter(ProtoArgType); + Param? InitializedEntity::InitializeParameter(Context, Param) + : InitializedEntity::InitializeParameter(Context, ProtoArgType); ExprResult ArgE = PerformCopyInitialization(Entity, SourceLocation(), Owned(Arg)); @@ -6232,12 +6231,12 @@ void Sema::ConvertPropertyAssignment(Expr *LHS, Expr *&RHS, QualType& LHSTy) { LHSTy->isRecordType()); if (copyInit) { InitializedEntity Entity = - InitializedEntity::InitializeParameter(LHSTy); + InitializedEntity::InitializeParameter(Context, LHSTy); Expr *Arg = RHS; ExprResult ArgE = PerformCopyInitialization(Entity, SourceLocation(), Owned(Arg)); if (!ArgE.isInvalid()) - RHS = ArgE.takeAs<Expr>(); + RHS = ArgE.takeAs<Expr>(); } } |