diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-12 01:55:21 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-12 01:55:21 +0000 |
commit | 3997b1b427ea96690c694eff7b9d593156e5763c (patch) | |
tree | bbf2276a9843e12fb438e0c24df3560b24b2b1ac /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | 1dc8a422812cdbc23edbf4856a49a2e15d3cc591 (diff) | |
download | bcm5719-llvm-3997b1b427ea96690c694eff7b9d593156e5763c.tar.gz bcm5719-llvm-3997b1b427ea96690c694eff7b9d593156e5763c.zip |
P0217R3: template instantiation support for decomposition declarations.
llvm-svn: 278458
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index a1ef6b408fc..41fcffd8cc0 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -1065,10 +1065,10 @@ struct BindingDiagnosticTrap { }; } -static bool -checkTupleLikeDecomposition(Sema &S, ArrayRef<BindingDecl *> Bindings, - ValueDecl *Src, InitializedEntity &ParentEntity, - QualType DecompType, llvm::APSInt TupleSize) { +static bool checkTupleLikeDecomposition(Sema &S, + ArrayRef<BindingDecl *> Bindings, + ValueDecl *Src, QualType DecompType, + llvm::APSInt TupleSize) { if ((int64_t)Bindings.size() != TupleSize) { S.Diag(Src->getLocation(), diag::err_decomp_decl_wrong_number_bindings) << DecompType << (unsigned)Bindings.size() << TupleSize.toString(10) @@ -1152,8 +1152,7 @@ checkTupleLikeDecomposition(Sema &S, ArrayRef<BindingDecl *> Bindings, if (RefType.isNull()) return true; - InitializedEntity Entity = - InitializedEntity::InitializeBinding(ParentEntity, B, RefType); + InitializedEntity Entity = InitializedEntity::InitializeBinding(B, RefType); InitializationKind Kind = InitializationKind::CreateCopy(Loc, Loc); InitializationSequence Seq(S, Entity, Kind, Init); E = Seq.Perform(S, Entity, Kind, Init); @@ -1341,8 +1340,7 @@ static bool checkMemberDecomposition(Sema &S, ArrayRef<BindingDecl*> Bindings, return false; } -void Sema::CheckCompleteDecompositionDeclaration(DecompositionDecl *DD, - InitializedEntity &Entity) { +void Sema::CheckCompleteDecompositionDeclaration(DecompositionDecl *DD) { QualType DecompType = DD->getType(); // If the type of the decomposition is dependent, then so is the type of @@ -1386,8 +1384,7 @@ void Sema::CheckCompleteDecompositionDeclaration(DecompositionDecl *DD, return; case IsTupleLike::TupleLike: - if (checkTupleLikeDecomposition(*this, Bindings, DD, Entity, DecompType, - TupleSize)) + if (checkTupleLikeDecomposition(*this, Bindings, DD, DecompType, TupleSize)) DD->setInvalidDecl(); return; |