aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index cd67955a22..95b2223658 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -666,7 +666,7 @@ Decl *Sema::ActOnTemplateTemplateParameter(Scope* S,
TemplateTemplateParmDecl::Create(Context, Context.getTranslationUnitDecl(),
NameLoc.isInvalid()? TmpLoc : NameLoc,
Depth, Position, Name,
- (TemplateParameterList*)Params);
+ Params);
// If the template template parameter has a name, then link the identifier
// into the scope and lookup mechanisms.
@@ -694,6 +694,11 @@ Decl *Sema::ActOnTemplateTemplateParameter(Scope* S,
Param->setDefaultArgument(DefaultArg, false);
}
+ if (Params->size() == 0) {
+ Diag(Param->getLocation(), diag::err_template_template_parm_no_parms)
+ << SourceRange(Params->getLAngleLoc(), Params->getRAngleLoc());
+ Param->setInvalidDecl();
+ }
return Param;
}