aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateDeduction.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-30 22:13:51 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-30 22:13:51 +0000
commit4a5c15f75f76b95e1c2ceb6fa2737dcadd5f4be1 (patch)
treef32210da86a1180ad3a91260f5fa5201a1224252 /lib/Sema/SemaTemplateDeduction.cpp
parent3307475eb0dd6e5d88be9392ea8247d0b6b812df (diff)
Improve template argument deduction in the case where the parameter
type is a template-id (e.g., basic_ostream<CharT, Traits>) and the argument type is a class that has a derived class matching the parameter type. Previously, we were giving up on template argument deduction too early. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83177 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r--lib/Sema/SemaTemplateDeduction.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index 64b7f8b140..b981389d1d 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -651,8 +651,7 @@ DeduceTemplateArguments(ASTContext &Context,
= DeduceTemplateArguments(Context, TemplateParams, SpecParam, Arg,
Info, Deduced);
- if (Result && (TDF & TDF_DerivedClass) &&
- Result != Sema::TDK_Inconsistent) {
+ if (Result && (TDF & TDF_DerivedClass)) {
// C++ [temp.deduct.call]p3b3:
// If P is a class, and P has the form template-id, then A can be a
// derived class of the deduced A. Likewise, if P is a pointer to a
@@ -690,11 +689,6 @@ DeduceTemplateArguments(ASTContext &Context,
// note that we had some success.
if (BaseResult == Sema::TDK_Success)
Successful = true;
- // If deduction against this base resulted in an inconsistent
- // set of deduced template arguments, template argument
- // deduction fails.
- else if (BaseResult == Sema::TDK_Inconsistent)
- return BaseResult;
}
// Visit base classes