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.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 53a02a9886..141c41618d 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -5954,3 +5954,33 @@ Sema::getTemplateArgumentBindingsText(const TemplateParameterList *Params,
Result += ']';
return Result;
}
+
+bool Sema::DiagnoseUnexpandedParameterPack(SourceLocation Loc,
+ TypeSourceInfo *T,
+ UnexpandedParameterPackContext UPPC) {
+ // C++0x [temp.variadic]p5:
+ // An appearance of a name of a parameter pack that is not expanded is
+ // ill-formed.
+ if (!T->getType()->containsUnexpandedParameterPack())
+ return false;
+
+ // FIXME: Provide the names and locations of the unexpanded parameter packs.
+ Diag(Loc, diag::err_unexpanded_parameter_pack)
+ << (int)UPPC << T->getTypeLoc().getSourceRange();
+ return true;
+}
+
+bool Sema::DiagnoseUnexpandedParameterPack(Expr *E,
+ UnexpandedParameterPackContext UPPC) {
+ // C++0x [temp.variadic]p5:
+ // An appearance of a name of a parameter pack that is not expanded is
+ // ill-formed.
+ if (!E->containsUnexpandedParameterPack())
+ return false;
+
+ // FIXME: Provide the names and locations of the unexpanded parameter packs.
+ Diag(E->getSourceRange().getBegin(), diag::err_unexpanded_parameter_pack)
+ << (int)UPPC << E->getSourceRange();
+ return true;
+}
+