diff options
author | John McCall <rjmccall@apple.com> | 2010-01-22 00:28:27 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-01-22 00:28:27 +0000 |
commit | f7b2fb51d191cb3fa668135a67c6b702c67d239e (patch) | |
tree | 191cee22788e6b2c217bc9bbec2434bd6a5a08c6 /clang/lib/Sema/SemaTemplate.cpp | |
parent | 268735610518957507a3dae771c8ae1f9d7a4fe0 (diff) | |
download | bcm5719-llvm-f7b2fb51d191cb3fa668135a67c6b702c67d239e.tar.gz bcm5719-llvm-f7b2fb51d191cb3fa668135a67c6b702c67d239e.zip |
Create function, block, and template parameters in the context of the
translation unit. This is temporary for function and block parameters;
template parameters can just stay this way, since Templates aren't
DeclContexts. This gives us the nice property that everything created
in a record DC should have access in C++.
llvm-svn: 94122
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 0773a0f1e4d..00401560c6a 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -449,8 +449,8 @@ Sema::DeclPtrTy Sema::ActOnTypeParameter(Scope *S, bool Typename, bool Ellipsis, Loc = KeyLoc; TemplateTypeParmDecl *Param - = TemplateTypeParmDecl::Create(Context, CurContext, Loc, - Depth, Position, ParamName, Typename, + = TemplateTypeParmDecl::Create(Context, Context.getTranslationUnitDecl(), + Loc, Depth, Position, ParamName, Typename, Ellipsis); if (Invalid) Param->setInvalidDecl(); @@ -572,7 +572,8 @@ Sema::DeclPtrTy Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, } NonTypeTemplateParmDecl *Param - = NonTypeTemplateParmDecl::Create(Context, CurContext, D.getIdentifierLoc(), + = NonTypeTemplateParmDecl::Create(Context, Context.getTranslationUnitDecl(), + D.getIdentifierLoc(), Depth, Position, ParamName, T, TInfo); if (Invalid) Param->setInvalidDecl(); @@ -625,8 +626,8 @@ Sema::DeclPtrTy Sema::ActOnTemplateTemplateParameter(Scope* S, // Construct the parameter object. TemplateTemplateParmDecl *Param = - TemplateTemplateParmDecl::Create(Context, CurContext, TmpLoc, Depth, - Position, Name, + TemplateTemplateParmDecl::Create(Context, Context.getTranslationUnitDecl(), + TmpLoc, Depth, Position, Name, (TemplateParameterList*)Params); // Make sure the parameter is valid. |