diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-06-24 00:54:41 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-06-24 00:54:41 +0000 |
commit | 52591bf224b2c43e2b00e265bb8599a620081925 (patch) | |
tree | a88f338e3fe56b008615af13b27afddc0fabfc0b /lib/Sema/SemaTemplate.cpp | |
parent | 43f24e05ce1914b2b064ab1915bb0beee8f04c26 (diff) |
Make sure that the template parameter lists get from the parser down to ActOnFunctionDeclarator for function template definitions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 4ecb44c3c5..63696a13d3 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -2507,6 +2507,27 @@ Sema::ActOnTemplateDeclarator(Scope *S, return HandleDeclarator(S, D, move(TemplateParameterLists), false); } +Sema::DeclPtrTy +Sema::ActOnStartOfFunctionTemplateDef(Scope *FnBodyScope, + MultiTemplateParamsArg TemplateParameterLists, + Declarator &D) { + assert(getCurFunctionDecl() == 0 && "Function parsing confused"); + assert(D.getTypeObject(0).Kind == DeclaratorChunk::Function && + "Not a function declarator!"); + DeclaratorChunk::FunctionTypeInfo &FTI = D.getTypeObject(0).Fun; + + if (FTI.hasPrototype) { + // FIXME: Diagnose arguments without names in C. + } + + Scope *ParentScope = FnBodyScope->getParent(); + + DeclPtrTy DP = HandleDeclarator(ParentScope, D, + move(TemplateParameterLists), + /*IsFunctionDefinition=*/true); + return ActOnStartOfFunctionDef(FnBodyScope, DP); +} + // Explicit instantiation of a class template specialization Sema::DeclResult Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation TemplateLoc, |