Hmm, I cannot recall why I did this. I will do some tests and if thing's
going well. I will apply you patch. Thanks!
- Yang
On 10/3/12 3:30 AM, Konstantin Tokarev wrote:
Hi Yang,
Why RemoveBaseClass ignores templates?
I have a test case (attached) which contains redundant base class A, which is
not eliminated by creduce because RemoveBaseClass skips template classes by
design.
After making the next patch it is eliminated:
diff --git a/clang_delta/RemoveBaseClass.cpp b/clang_delta/RemoveBaseClass.cpp
index 41bae82..219c5d8 100644
--- a/clang_delta/RemoveBaseClass.cpp
+++ b/clang_delta/RemoveBaseClass.cpp
@@ -147,8 +147,7 @@ bool RemoveBaseClass::isDirectlyDerivedFrom(const
CXXRecordDecl *SubC,
void RemoveBaseClass::handleOneCXXRecordDecl(const CXXRecordDecl *CXXRD)
{
- if (isSpecialRecordDecl(CXXRD) || CXXRD->getDescribedClassTemplate() ||
- !CXXRD->hasDefinition())
+ if (isSpecialRecordDecl(CXXRD) || !CXXRD->hasDefinition())
return;