summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-11 18:16:40 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-11 18:16:40 +0000
commitf8f868336ed33869bb4d196849bf8df21d3b64dd (patch)
tree587ff8aae736c8d9f0046eed07c48d1b96c324b6 /clang/lib/Sema/SemaTemplate.cpp
parentd5581d2af1a8215c41b58d9554fc415aa8d7fdc5 (diff)
downloadbcm5719-llvm-f8f868336ed33869bb4d196849bf8df21d3b64dd.tar.gz
bcm5719-llvm-f8f868336ed33869bb4d196849bf8df21d3b64dd.zip
Allow the use of default template arguments when forming a class
template specialization (e.g., std::vector<int> would now be well-formed, since it relies on a default argument for the Allocator template parameter). This is much less interesting than one might expect, since (1) we're not actually using the default arguments for anything important, such as naming an actual Decl, and (2) we'll often need to instantiate the default arguments to check their well-formedness. The real fun will come later. llvm-svn: 64310
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 86f1e2017f1..b4436a2c3c1 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -685,7 +685,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
bool Invalid = false;
if (NumArgs > NumParams ||
- NumArgs < NumParams /*FIXME: default arguments! */) {
+ NumArgs < Params->getMinRequiredArguments()) {
// FIXME: point at either the first arg beyond what we can handle,
// or the '>', depending on whether we have too many or too few
// arguments.
@@ -698,7 +698,8 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
isa<FunctionTemplateDecl>(Template)? 1 :
isa<TemplateTemplateParmDecl>(Template)? 2 : 3)
<< Template << Range;
-
+ Diag(Template->getLocation(), diag::note_template_decl_here)
+ << Params->getSourceRange();
Invalid = true;
}
OpenPOWER on IntegriCloud