summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateDeduction.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-10-12 18:51:08 +0000
committerDouglas Gregor <dgregor@apple.com>2010-10-12 18:51:08 +0000
commit6e9cf630f815780bb84533a51bcbe9c840ded15b (patch)
treef959c94fa67ed6e2e541b4af96d5cf8ffdc2e4d1 /clang/lib/Sema/SemaTemplateDeduction.cpp
parent758cb67fcfc602b40e1e4448be5802c70f4cff04 (diff)
downloadbcm5719-llvm-6e9cf630f815780bb84533a51bcbe9c840ded15b.tar.gz
bcm5719-llvm-6e9cf630f815780bb84533a51bcbe9c840ded15b.zip
When finalizing a function template specialization following template
argument deduction, make sure to check the correctness of deduced template type arguments (which we had previously skipped) along with other kinds of template arguments. This fixes part of PR6784, but we're still swallowing the extension warning about unnamed/local template arguments. llvm-svn: 116327
Diffstat (limited to 'clang/lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateDeduction.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index f3ffa716f1b..6237610c098 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -1018,7 +1018,7 @@ FinishTemplateArgumentDeduction(Sema &S,
for (unsigned I = 0, N = Deduced.size(); I != N; ++I) {
if (Deduced[I].isNull()) {
Decl *Param
- = const_cast<NamedDecl *>(
+ = const_cast<NamedDecl *>(
Partial->getTemplateParameters()->getParam(I));
Info.Param = makeTemplateParameter(Param);
return Sema::TDK_Incomplete;
@@ -1383,13 +1383,10 @@ Sema::FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate,
for (unsigned I = 0, N = Deduced.size(); I != N; ++I) {
NamedDecl *Param = FunctionTemplate->getTemplateParameters()->getParam(I);
if (!Deduced[I].isNull()) {
- if (I < NumExplicitlySpecified ||
- Deduced[I].getKind() == TemplateArgument::Type) {
+ if (I < NumExplicitlySpecified) {
// We have already fully type-checked and converted this
- // argument (because it was explicitly-specified) or no
- // additional checking is necessary (because it's a template
- // type parameter). Just record the presence of this
- // parameter.
+ // argument, because it was explicitly-specified. Just record the
+ // presence of this argument.
Builder.Append(Deduced[I]);
continue;
}
OpenPOWER on IntegriCloud