summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-10 20:44:00 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-10 20:44:00 +0000
commit79cf603428c2d93d80f1871c24c8c35805225d31 (patch)
tree33d96b462058d10958b5c3b69a226119e83bb388 /clang/lib/Sema/SemaTemplate.cpp
parente8dd2847ff3eb3918bfb07706920e741d21608fd (diff)
downloadbcm5719-llvm-79cf603428c2d93d80f1871c24c8c35805225d31.tar.gz
bcm5719-llvm-79cf603428c2d93d80f1871c24c8c35805225d31.zip
Extend the notion of active template instantiations to include the
context of a template-id for which we need to instantiate default template arguments. In the TextDiagnosticPrinter, don't suppress the caret diagnostic if we are producing a non-note diagnostic that follows a note diagnostic with the same location, because notes are (conceptually) a part of the warning or error that comes before them. llvm-svn: 66572
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index fc1173d9d16..ea91a3836a5 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -825,10 +825,15 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
// If the argument type is dependent, instantiate it now based
// on the previously-computed template arguments.
- if (ArgType->isDependentType())
+ if (ArgType->isDependentType()) {
+ InstantiatingTemplate Inst(*this, TemplateLoc,
+ Template, &Converted[0],
+ Converted.size(),
+ SourceRange(TemplateLoc, RAngleLoc));
ArgType = InstantiateType(ArgType, &Converted[0], Converted.size(),
TTP->getDefaultArgumentLoc(),
TTP->getDeclName());
+ }
if (ArgType.isNull())
return true;
@@ -888,6 +893,11 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
QualType NTTPType = NTTP->getType();
if (NTTPType->isDependentType()) {
// Instantiate the type of the non-type template parameter.
+ InstantiatingTemplate Inst(*this, TemplateLoc,
+ Template, &Converted[0],
+ Converted.size(),
+ SourceRange(TemplateLoc, RAngleLoc));
+
NTTPType = InstantiateType(NTTPType,
&Converted[0], Converted.size(),
NTTP->getLocation(),
OpenPOWER on IntegriCloud