aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateDeduction.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-05-13 07:48:05 +0000
committerJohn McCall <rjmccall@apple.com>2010-05-13 07:48:05 +0000
commitc0008349f233e70e3ffabe7b31eab5d9859bc25f (patch)
treede2e9a2b657ebac2af1bdef8109c4a80639f21bf /lib/Sema/SemaTemplateDeduction.cpp
parent197113b2c41f49224c83f901c2bb0d822b75d480 (diff)
When performing template argument deduction, match Objective C pointers
against pointer patterns. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103706 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r--lib/Sema/SemaTemplateDeduction.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index b85f2bd422..733d0e9e9a 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -482,14 +482,20 @@ DeduceTemplateArguments(Sema &S,
// T *
case Type::Pointer: {
- const PointerType *PointerArg = Arg->getAs<PointerType>();
- if (!PointerArg)
+ QualType PointeeType;
+ if (const PointerType *PointerArg = Arg->getAs<PointerType>()) {
+ PointeeType = PointerArg->getPointeeType();
+ } else if (const ObjCObjectPointerType *PointerArg
+ = Arg->getAs<ObjCObjectPointerType>()) {
+ PointeeType = PointerArg->getPointeeType();
+ } else {
return Sema::TDK_NonDeducedMismatch;
+ }
unsigned SubTDF = TDF & (TDF_IgnoreQualifiers | TDF_DerivedClass);
return DeduceTemplateArguments(S, TemplateParams,
cast<PointerType>(Param)->getPointeeType(),
- PointerArg->getPointeeType(),
+ PointeeType,
Info, Deduced, SubTDF);
}