diff options
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 14 |
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(); |