Move the work-in-progress implementation of variadic templates to its own file in Sema. No functionality change.

llvm-svn: 121869
This commit is contained in:
Douglas Gregor 2010-12-15 17:38:57 +00:00
parent 9168a4f1c2
commit b55fdf8c6f
3 changed files with 47 additions and 29 deletions

View File

@ -33,6 +33,7 @@ add_clang_library(clangSema
SemaTemplateDeduction.cpp SemaTemplateDeduction.cpp
SemaTemplateInstantiate.cpp SemaTemplateInstantiate.cpp
SemaTemplateInstantiateDecl.cpp SemaTemplateInstantiateDecl.cpp
SemaTemplateVariadic.cpp
SemaType.cpp SemaType.cpp
TargetAttributesSema.cpp TargetAttributesSema.cpp
) )

View File

@ -5961,32 +5961,3 @@ Sema::getTemplateArgumentBindingsText(const TemplateParameterList *Params,
return 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;
}

View File

@ -0,0 +1,46 @@
//===------- SemaTemplateVariadic.cpp - C++ Variadic Templates ------------===/
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//===----------------------------------------------------------------------===/
//
// This file implements semantic analysis for C++0x variadic templates.
//===----------------------------------------------------------------------===/
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/AST/Expr.h"
#include "clang/AST/TypeLoc.h"
using namespace clang;
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;
}