aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-10 00:53:15 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-10 00:53:15 +0000
commit8b642592a35167a3780074e78674e0bece87c40c (patch)
treee0ae2fbbb5ae014d68d4a54e1270235928db8fd6 /lib/Sema/SemaTemplate.cpp
parentdd0574e76439f31c02ba54bd7708725176f9531f (diff)
Teach the type-id/expression disambiguator about different
disambiguation contexts, so that we properly parse template arguments such as A<int()> as type-ids rather than as expressions. Since this can be confusing (especially when the template parameter is a non-type template parameter), we try to give a friendly error message. Almost, eliminate a redundant error message (that should have been a note) and add some ultra-basic checks for non-type template arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 1a2da84642..ecbc860d1d 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -458,7 +458,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
// is an expression.
Diag(ArgExpr->getSourceRange().getBegin(),
diag::err_template_arg_must_be_type);
- Diag((*Param)->getLocation(), diag::note_template_parameter_here);
+ Diag((*Param)->getLocation(), diag::note_template_param_here);
Invalid = true;
} else if (NonTypeTemplateParmDecl *NTTP
= dyn_cast<NonTypeTemplateParmDecl>(*Param)) {
@@ -484,7 +484,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
<< ArgType;
else
Diag(ArgLoc, diag::err_template_arg_must_be_expr);
- Diag((*Param)->getLocation(), diag::note_template_parameter_here);
+ Diag((*Param)->getLocation(), diag::note_template_param_here);
Invalid = true;
} else {
// Check template template parameters.