diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-12-16 01:38:02 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-12-16 01:38:02 +0000 |
| commit | 85dabae6ad94925a9ec99cdf375c4e8768ea0e03 (patch) | |
| tree | b7b5c40acc05b847924ea8b58179a4ba2d309963 /clang/lib/Sema/SemaDeclCXX.cpp | |
| parent | 1be62860283ce4e138f73476be6a7a03c488ae3d (diff) | |
| download | bcm5719-llvm-85dabae6ad94925a9ec99cdf375c4e8768ea0e03.tar.gz bcm5719-llvm-85dabae6ad94925a9ec99cdf375c4e8768ea0e03.zip | |
Switch the C++ new expression over to InitializationSequence, rather
than using its own partial implementation of initialization.
Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.
Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.
Implemented support for default initialization in
InitializationSequence.
Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.
Taught CXXConstructExpr to store more location information.
llvm-svn: 91492
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 80d67efae9b..a70841f536d 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -125,8 +125,10 @@ Sema::SetParamDefaultArgument(ParmVarDecl *Param, ExprArg DefaultArg, // the same semantic constraints as the initializer expression in // a declaration of a variable of the parameter type, using the // copy-initialization semantics (8.5). - if (CheckInitializerTypes(Arg, ParamType, EqualLoc, - Param->getDeclName(), /*DirectInit=*/false)) + InitializedEntity Entity = InitializedEntity::InitializeParameter(Param); + InitializationKind Kind = InitializationKind::CreateCopy(Param->getLocation(), + EqualLoc); + if (CheckInitializerTypes(Arg, ParamType, Entity, Kind)) return true; Arg = MaybeCreateCXXExprWithTemporaries(Arg); @@ -3775,7 +3777,8 @@ Sema::BuildCXXConstructExpr(SourceLocation ConstructLoc, QualType DeclInitType, Expr **Exprs = (Expr **)ExprArgs.release(); MarkDeclarationReferenced(ConstructLoc, Constructor); - return Owned(CXXConstructExpr::Create(Context, DeclInitType, Constructor, + return Owned(CXXConstructExpr::Create(Context, DeclInitType, ConstructLoc, + Constructor, Elidable, Exprs, NumExprs)); } |

