aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-11 23:06:43 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-11 23:06:43 +0000
commitdb0d4b751e83b8841b8f48f913f17e50467f13d4 (patch)
treedacbc00c291d96ddf195da7a3a59f41f5cfaa56b /lib/Sema/SemaTemplate.cpp
parent8406aedf4782771e520614ee379594dc0a4f7d5f (diff)
Template argument deduction for template template parameters. This
permits, among other things, ripping apart and reconstructing templates via partial specialization: template<typename T> struct DeepRemoveConst { typedef T type; }; template<typename T> struct DeepRemoveConst<const T> { typedef typename DeepRemoveConst<T>::type type; }; template<template<typename> class TT, typename T> struct DeepRemoveConst<TT<T> > { typedef TT<typename DeepRemoveConst<T>::type> type; }; Also, fix a longstanding thinko in the code handling partial ordering of class template partial specializations. We were performing the second deduction without clearing out the results of the first deduction. It's amazing we got through so much code with such a horrendous error :( git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index ee928bccaf..9305d6ebb1 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -2607,10 +2607,6 @@ Sema::TemplateParameterListsAreEqual(TemplateParameterList *New,
}
return false;
}
- assert(OldNTTP->getDepth() == NewNTTP->getDepth() &&
- "Non-type template parameter depth mismatch");
- assert(OldNTTP->getPosition() == NewNTTP->getPosition() &&
- "Non-type template parameter position mismatch");
} else {
// The template parameter lists of template template
// parameters must agree.
@@ -2626,11 +2622,6 @@ Sema::TemplateParameterListsAreEqual(TemplateParameterList *New,
/*IsTemplateTemplateParm=*/true,
TemplateArgLoc))
return false;
-
- assert(OldTTP->getDepth() == NewTTP->getDepth() &&
- "Template template parameter depth mismatch");
- assert(OldTTP->getPosition() == NewTTP->getPosition() &&
- "Template template parameter position mismatch");
}
}