Don't classify variable template names as type templates.

llvm-svn: 291528
This commit is contained in:
Richard Smith 2017-01-10 02:15:49 +00:00
parent 0697ae2ad9
commit f388f78bc6
2 changed files with 7 additions and 1 deletions

View File

@ -1044,7 +1044,8 @@ Corrected:
}
// We can have a type template here if we're classifying a template argument.
if (isa<TemplateDecl>(FirstDecl) && !isa<FunctionTemplateDecl>(FirstDecl))
if (isa<TemplateDecl>(FirstDecl) && !isa<FunctionTemplateDecl>(FirstDecl) &&
!isa<VarTemplateDecl>(FirstDecl))
return NameClassification::TypeTemplate(
TemplateName(cast<TemplateDecl>(FirstDecl)));

View File

@ -464,3 +464,8 @@ template <typename... Args> Variadic_t<Args...> Variadic;
auto variadic1 = Variadic<>;
auto variadic2 = Variadic<int, int>;
#endif
namespace VexingParse {
template <typename> int var; // expected-note {{declared here}}
int x(var); // expected-error {{cannot refer to variable template 'var' without a template argument list}}
}