From: John McCall Date: Thu, 29 Apr 2010 01:18:58 +0000 (+0000) Subject: Access-check during template argument deduction from the context of the X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96db310ab7ca59e1890ddef25a3701bc2909d20f;p=clang Access-check during template argument deduction from the context of the template decl itself, not its context. Testcase to follow; fixes selfhost. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102578 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp index 13bfc0fdf9..e7a12d6b70 100644 --- a/lib/Sema/SemaTemplateDeduction.cpp +++ b/lib/Sema/SemaTemplateDeduction.cpp @@ -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