Access-check during template argument deduction from the context of the

template decl itself, not its context.  Testcase to follow;  fixes selfhost.

llvm-svn: 102578
This commit is contained in:
John McCall 2010-04-29 01:18:58 +00:00
parent 250e917e9d
commit e23b871c4b
1 changed files with 3 additions and 3 deletions

View File

@ -988,7 +988,7 @@ Sema::DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial,
if (Inst)
return TDK_InstantiationDepth;
ContextRAII SavedContext(*this, Partial->getDeclContext());
ContextRAII SavedContext(*this, Partial);
// C++ [temp.deduct.type]p2:
// [...] or if any template argument remains neither deduced nor
@ -1165,7 +1165,7 @@ Sema::SubstituteExplicitTemplateArguments(
if (Inst)
return TDK_InstantiationDepth;
ContextRAII SavedContext(*this, FunctionTemplate->getDeclContext());
ContextRAII SavedContext(*this, FunctionTemplate->getTemplatedDecl());
if (CheckTemplateArgumentList(FunctionTemplate,
SourceLocation(),
@ -1315,7 +1315,7 @@ Sema::FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate,
if (Inst)
return TDK_InstantiationDepth;
ContextRAII SavedContext(*this, FunctionTemplate->getDeclContext());
ContextRAII SavedContext(*this, FunctionTemplate->getTemplatedDecl());
// C++ [temp.deduct.type]p2:
// [...] or if any template argument remains neither deduced nor