summaryrefslogtreecommitdiffstats
path: root/clang/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
commit97f34576d4a50a24f4154b85bcff9e29b240e8ac (patch)
treec507dc5a4c8cc7807d7a3d59474cb18a46c68365 /clang/lib/Sema/SemaTemplate.cpp
parent85e0f66250637165a815ef78ab4b3fe102d75c8b (diff)
downloadbcm5719-llvm-97f34576d4a50a24f4154b85bcff9e29b240e8ac.tar.gz
bcm5719-llvm-97f34576d4a50a24f4154b85bcff9e29b240e8ac.zip
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. llvm-svn: 64189
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 1a2da846429..ecbc860d1df 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud