diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-12-24 02:52:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-12-24 02:52:09 +0000 |
commit | b9bd8a994c8c871faf338649438a3409f67da394 (patch) | |
tree | 38511cc0bc3fd8f00a88a3346fdbe675325a6442 /clang/lib/Sema/SemaTemplate.cpp | |
parent | a283f91a67a852c311086298908c49e880a838de (diff) | |
download | bcm5719-llvm-b9bd8a994c8c871faf338649438a3409f67da394.tar.gz bcm5719-llvm-b9bd8a994c8c871faf338649438a3409f67da394.zip |
Keep track of template arguments when we parse them. Right now, we don't actually do anything with the template arguments, but they'll be used to create template declarations
llvm-svn: 61413
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index d300f283b66..f448664615a 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -86,7 +86,8 @@ bool Sema::DiagnoseTemplateParameterShadow(SourceLocation Loc, Decl *PrevDecl) { Sema::DeclTy *Sema::ActOnTypeParameter(Scope *S, bool Typename, SourceLocation KeyLoc, IdentifierInfo *ParamName, - SourceLocation ParamNameLoc) { + SourceLocation ParamNameLoc, + unsigned Depth, unsigned Position) { assert(S->isTemplateParamScope() && "Template type parameter not in template parameter scope!"); bool Invalid = false; @@ -117,7 +118,9 @@ Sema::DeclTy *Sema::ActOnTypeParameter(Scope *S, bool Typename, /// template parameter (e.g., "int Size" in "template<int Size> /// class Array") has been parsed. S is the current scope and D is /// the parsed declarator. -Sema::DeclTy *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D) { +Sema::DeclTy *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, + unsigned Depth, + unsigned Position) { QualType T = GetTypeForDeclarator(D, S); assert(S->isTemplateParamScope() && @@ -145,3 +148,18 @@ Sema::DeclTy *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D) { } return Param; } + +/// ActOnTemplateParameterList - Builds a TemplateParameterList that +/// contains the template parameters in Params/NumParams. +Sema::TemplateParamsTy * +Sema::ActOnTemplateParameterList(unsigned Depth, + SourceLocation ExportLoc, + SourceLocation TemplateLoc, + SourceLocation LAngleLoc, + DeclTy **Params, unsigned NumParams, + SourceLocation RAngleLoc) { + if (ExportLoc.isValid()) + Diag(ExportLoc, diag::note_template_export_unsupported); + + return TemplateParameterList::Create(Context, (Decl**)Params, NumParams); +} |