summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateDeduction.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-11 19:55:36 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-11 19:55:36 +0000
commitb90b66178ef7cdb0247b61b0f2c07ff0c77d4dbb (patch)
tree55d6972294fdce75a25175243e10bd3ab6c458e9 /clang/lib/Sema/SemaTemplateDeduction.cpp
parent0662b16ad234f241331191c90753b8de90185207 (diff)
downloadbcm5719-llvm-b90b66178ef7cdb0247b61b0f2c07ff0c77d4dbb.tar.gz
bcm5719-llvm-b90b66178ef7cdb0247b61b0f2c07ff0c77d4dbb.zip
When resolving a single function template specialization to a
function, be sure to adjust the resulting argument type to a pointer (if necessary). Fixes PR5910 and PR5949. llvm-svn: 93178
Diffstat (limited to 'clang/lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateDeduction.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index ea79d9fd78c..471d0c2a2ab 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -1473,8 +1473,11 @@ Sema::DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
return TDK_FailedOverloadResolution;
}
- // Get the type of the resolved argument.
+ // Get the type of the resolved argument, and adjust it per
+ // C++0x [temp.deduct.call]p3.
ArgType = ResolvedArg->getType();
+ if (!ParamWasReference && ArgType->isFunctionType())
+ ArgType = Context.getPointerType(ArgType);
if (ArgType->isPointerType() || ArgType->isMemberPointerType())
TDF |= TDF_IgnoreQualifiers;
OpenPOWER on IntegriCloud