diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-30 04:38:28 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-30 04:38:28 +0000 |
commit | c95726ea39372286ebd3a28e3176921cddc65c62 (patch) | |
tree | 480af02030c69633f80ce738e6090d1eb1eb0144 /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
parent | e4ddaa44272f55d95a2377f900f9ab3b296b6366 (diff) | |
download | bcm5719-llvm-c95726ea39372286ebd3a28e3176921cddc65c62.tar.gz bcm5719-llvm-c95726ea39372286ebd3a28e3176921cddc65c62.zip |
Towards P0091R3: parsing support for class template argument deduction in typename-specifiers.
llvm-svn: 293455
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index aff19ec597e..723a6c0e4de 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/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, |