summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-01-30 04:38:28 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-01-30 04:38:28 +0000
commitc95726ea39372286ebd3a28e3176921cddc65c62 (patch)
tree480af02030c69633f80ce738e6090d1eb1eb0144 /clang/lib/Sema/SemaTemplate.cpp
parente4ddaa44272f55d95a2377f900f9ab3b296b6366 (diff)
downloadbcm5719-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/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 8f46ad056b7..d3b47f13410 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -8792,8 +8792,18 @@ Sema::CheckTypenameType(ElaboratedTypeKeyword Keyword,
Context.getTypeDeclType(Type));
}
- // FIXME: Form a deduced template specialization type if we get a template
- // declaration here.
+ // C++ [dcl.type.simple]p2:
+ // A type-specifier of the form
+ // typename[opt] nested-name-specifier[opt] template-name
+ // is a placeholder for a deduced class type [...].
+ if (getLangOpts().CPlusPlus1z) {
+ if (auto *TD = getAsTypeTemplateDecl(Result.getFoundDecl())) {
+ return Context.getElaboratedType(
+ Keyword, QualifierLoc.getNestedNameSpecifier(),
+ Context.getDeducedTemplateSpecializationType(TemplateName(TD),
+ QualType(), false));
+ }
+ }
DiagID = diag::err_typename_nested_not_type;
Referenced = Result.getFoundDecl();
OpenPOWER on IntegriCloud