aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 5b2e89e8b0..aabbffa4c3 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -5,11 +5,11 @@
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
-//+//===----------------------------------------------------------------------===/
+//===----------------------------------------------------------------------===/
//
// This file implements semantic analysis for C++ templates.
-//+//===----------------------------------------------------------------------===/
+//===----------------------------------------------------------------------===/
#include "Sema.h"
#include "clang/AST/ASTContext.h"
@@ -757,6 +757,17 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
break;
ArgType = TTP->getDefaultArgument();
+
+ // If the argument type is dependent, instantiate it now based
+ // on the previously-computed template arguments.
+ if (ArgType->isDependentType())
+ ArgType = InstantiateType(ArgType, &Converted[0], Converted.size(),
+ TTP->getDefaultArgumentLoc(),
+ TTP->getDeclName());
+
+ if (ArgType.isNull())
+ break;
+
ArgLoc = TTP->getDefaultArgumentLoc();
} else if (NonTypeTemplateParmDecl *NTTP
= dyn_cast<NonTypeTemplateParmDecl>(*Param)) {