summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateDeduction.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-19 00:20:19 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-19 00:20:19 +0000
commitf733268e7aaa1a232542cc97811fa0f8a4ddbad7 (patch)
tree1a8b33ca3e8f500e2963c92d530bc2c7f35e3119 /clang/lib/Sema/SemaTemplateDeduction.cpp
parentdb5382093d4652fa06bd678425f19ab0a3647526 (diff)
downloadbcm5719-llvm-f733268e7aaa1a232542cc97811fa0f8a4ddbad7.tar.gz
bcm5719-llvm-f733268e7aaa1a232542cc97811fa0f8a4ddbad7.zip
When deducing the element type of an array, ignore qualifiers if
the context allows us to ignore qualifiers on the array type itself. llvm-svn: 111486
Diffstat (limited to 'clang/lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateDeduction.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index 1bd041d9eff..97ad6bea336 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -530,10 +530,11 @@ DeduceTemplateArguments(Sema &S,
if (!IncompleteArrayArg)
return Sema::TDK_NonDeducedMismatch;
+ unsigned SubTDF = TDF & TDF_IgnoreQualifiers;
return DeduceTemplateArguments(S, TemplateParams,
S.Context.getAsIncompleteArrayType(Param)->getElementType(),
IncompleteArrayArg->getElementType(),
- Info, Deduced, 0);
+ Info, Deduced, SubTDF);
}
// T [integer-constant]
@@ -548,10 +549,11 @@ DeduceTemplateArguments(Sema &S,
if (ConstantArrayArg->getSize() != ConstantArrayParm->getSize())
return Sema::TDK_NonDeducedMismatch;
+ unsigned SubTDF = TDF & TDF_IgnoreQualifiers;
return DeduceTemplateArguments(S, TemplateParams,
ConstantArrayParm->getElementType(),
ConstantArrayArg->getElementType(),
- Info, Deduced, 0);
+ Info, Deduced, SubTDF);
}
// type [i]
@@ -560,6 +562,8 @@ DeduceTemplateArguments(Sema &S,
if (!ArrayArg)
return Sema::TDK_NonDeducedMismatch;
+ unsigned SubTDF = TDF & TDF_IgnoreQualifiers;
+
// Check the element type of the arrays
const DependentSizedArrayType *DependentArrayParm
= S.Context.getAsDependentSizedArrayType(Param);
@@ -567,7 +571,7 @@ DeduceTemplateArguments(Sema &S,
= DeduceTemplateArguments(S, TemplateParams,
DependentArrayParm->getElementType(),
ArrayArg->getElementType(),
- Info, Deduced, 0))
+ Info, Deduced, SubTDF))
return Result;
// Determine the array bound is something we can deduce.
OpenPOWER on IntegriCloud