diff options
author | John McCall <rjmccall@apple.com> | 2010-11-10 02:40:36 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-10 02:40:36 +0000 |
commit | 9b72f89f0fade44dc431fdb9557523439f98ae11 (patch) | |
tree | c1c0760cdd280859cddd41d2bdf96d508fc9104c /clang/lib/Sema/SemaTemplate.cpp | |
parent | a4ceea8cd86c4fc649c7c79499ae9dddb9ea20e0 (diff) | |
download | bcm5719-llvm-9b72f89f0fade44dc431fdb9557523439f98ae11.tar.gz bcm5719-llvm-9b72f89f0fade44dc431fdb9557523439f98ae11.zip |
Diagnose attempst to template using declarations and using directives.
Recover from the latter and fail early for the former. Fixes PR8022.
llvm-svn: 118669
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index d7c809f35dd..3243903863d 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -30,6 +30,14 @@ using namespace clang; using namespace sema; +// Exported for use by Parser. +SourceRange +clang::getTemplateParamsRange(TemplateParameterList const * const *Ps, + unsigned N) { + if (!N) return SourceRange(); + return SourceRange(Ps[0]->getTemplateLoc(), Ps[N-1]->getRAngleLoc()); +} + /// \brief Determine whether the declaration found is acceptable as the name /// of a template and, if so, return that template declaration. Otherwise, /// returns NULL. |