diff options
author | John McCall <rjmccall@apple.com> | 2010-04-29 01:18:58 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-04-29 01:18:58 +0000 |
commit | e23b871c4b8c01aa4f18423727ef9a7e1afb5e21 (patch) | |
tree | 029b0543aa2c1a6db21f42082be33344ac6885ec | |
parent | 250e917e9d7b4ecd89ffffb5012527047dd90dee (diff) | |
download | bcm5719-llvm-e23b871c4b8c01aa4f18423727ef9a7e1afb5e21.tar.gz bcm5719-llvm-e23b871c4b8c01aa4f18423727ef9a7e1afb5e21.zip |
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
-rw-r--r-- | clang/lib/Sema/SemaTemplateDeduction.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index 13bfc0fdf9e..e7a12d6b703 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/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 |