diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-21 23:17:24 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-21 23:17:24 +0000 |
commit | 4b52e25f3b05ab0f9d2492276a52323a50a84fb7 (patch) | |
tree | 5d7475db3666f0c34a3c9381783dec79793760ba /lib/Sema/SemaTemplate.cpp | |
parent | c78a69dd901f200de958063997946119e366e4d2 (diff) |
When a template-id refers to a single function template, and the
explicitly-specified template arguments are enough to determine the
instantiation, and either template argument deduction fails or is not
performed in that context, we can resolve the template-id down to a
function template specialization (so sayeth C++0x
[temp.arg.explicit]p3). Fixes PR5811.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91852 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 9b046e3696..e6bd77d208 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -2189,6 +2189,9 @@ bool Sema::CheckTemplateArgument(TemplateTypeParmDecl *Param, Diag(SR.getBegin(), diag::err_template_arg_unnamed_type) << SR; Diag(Tag->getDecl()->getLocation(), diag::note_template_unnamed_type_here); return true; + } else if (Context.hasSameUnqualifiedType(Arg, Context.OverloadTy)) { + SourceRange SR = ArgInfo->getTypeLoc().getFullSourceRange(); + return Diag(SR.getBegin(), diag::err_template_arg_overload_type) << SR; } return false; |