forked from OSchip/llvm-project
Don't classify variable template names as type templates.
llvm-svn: 291528
This commit is contained in:
parent
0697ae2ad9
commit
f388f78bc6
|
@ -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)));
|
||||
|
||||
|
|
|
@ -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}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue