Fix a case when the TemplateArgs vector can be empty.

llvm-svn: 72911
This commit is contained in:
Anders Carlsson 2009-06-05 02:12:32 +00:00
parent dd050567c1
commit dd096d888b
2 changed files with 4 additions and 1 deletions

View File

@ -2271,7 +2271,7 @@ Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation TemplateLoc,
// template.
llvm::SmallVector<TemplateArgument, 16> ConvertedTemplateArgs;
if (CheckTemplateArgumentList(ClassTemplate, TemplateNameLoc, LAngleLoc,
&TemplateArgs[0], TemplateArgs.size(),
TemplateArgs.data(), TemplateArgs.size(),
RAngleLoc, ConvertedTemplateArgs))
return true;

View File

@ -10,3 +10,6 @@ X<> *x3; // expected-error{{too few template arguments for class template 'X'}}
template<typename U = float, int M> struct X;
X<> *x4;
template<typename T = int> struct Z;
template struct Z<>;