diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-30 20:39:26 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-30 20:39:26 +0000 |
commit | b4b0b5984b0819a390d74e4c293c808760511ab5 (patch) | |
tree | 8fd9b1ec530fe211d40d2e8e57a0ae38a8fa60c3 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 41b308f8a902b487ddd4aa8cf8206267874767ec (diff) |
Towards P0091R3: parsing support for class template argument deduction in typename-specifiers.
This reinstates r293455, reverted in r293455, with a fix for cv-qualifier
handling on dependent typename-specifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293544 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index aff19ec597..723a6c0e4d 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -1490,12 +1490,16 @@ TemplateInstantiator::TransformSubstTemplateTypeParmPackType( /// a cast expression) or that the entity has no name (e.g., an /// unnamed function parameter). /// +/// \param AllowDeducedTST Whether a DeducedTemplateSpecializationType is +/// acceptable as the top level type of the result. +/// /// \returns If the instantiation succeeds, the instantiated /// type. Otherwise, produces diagnostics and returns a NULL type. TypeSourceInfo *Sema::SubstType(TypeSourceInfo *T, const MultiLevelTemplateArgumentList &Args, SourceLocation Loc, - DeclarationName Entity) { + DeclarationName Entity, + bool AllowDeducedTST) { assert(!ActiveTemplateInstantiations.empty() && "Cannot perform an instantiation without some context on the " "instantiation stack"); @@ -1505,7 +1509,8 @@ TypeSourceInfo *Sema::SubstType(TypeSourceInfo *T, return T; TemplateInstantiator Instantiator(*this, Args, Loc, Entity); - return Instantiator.TransformType(T); + return AllowDeducedTST ? Instantiator.TransformTypeWithDeducedTST(T) + : Instantiator.TransformType(T); } TypeSourceInfo *Sema::SubstType(TypeLoc TL, |