Add Decl::isParameterPack(), which covers both function and template
parameter packs, along with ParmVarDecl::isParameterPack(), which
looks for function parameter packs. Use these routines to fix some
obvious FIXMEs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122904 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateVariadic.cpp b/lib/Sema/SemaTemplateVariadic.cpp
index fb88bd1..3090d15 100644
--- a/lib/Sema/SemaTemplateVariadic.cpp
+++ b/lib/Sema/SemaTemplateVariadic.cpp
@@ -602,9 +602,8 @@
case LookupResult::NotFoundInCurrentInstantiation:
if (DeclarationName CorrectedName = CorrectTypo(R, S, 0, 0, false,
CTC_NoKeywords)) {
- // FIXME: Variadic templates function parameter packs.
if (NamedDecl *CorrectedResult = R.getAsSingle<NamedDecl>())
- if (CorrectedResult->isTemplateParameterPack()) {
+ if (CorrectedResult->isParameterPack()) {
ParameterPack = CorrectedResult;
Diag(NameLoc, diag::err_sizeof_pack_no_pack_name_suggest)
<< &Name << CorrectedName
@@ -624,8 +623,7 @@
return ExprError();
}
- // FIXME: Variadic templates function parameter packs.
- if (!ParameterPack || !ParameterPack->isTemplateParameterPack()) {
+ if (!ParameterPack || !ParameterPack->isParameterPack()) {
Diag(NameLoc, diag::err_sizeof_pack_no_pack_name)
<< &Name;
return ExprError();