[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdevplatform/language/duchain
From:       David Nolden <david.nolden.kde () art-master ! de>
Date:       2009-02-28 16:43:42
Message-ID: 1235839422.543510.32747.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 933315 by zwabel:

Re-enable the un-aliasing for template-parameters, and do it deeply. Unfortunately \
this is required.


 M  +27 -4     instantiationinformation.cpp  


--- trunk/KDE/kdevplatform/language/duchain/instantiationinformation.cpp \
#933314:933315 @@ -21,6 +21,7 @@
 #include "repositories/itemrepository.h"
 #include "types/typeutils.h"
 #include <typeinfo>
+#include "types/typealiastype.h"
 
 
 namespace KDevelop {
@@ -61,10 +62,32 @@
 }
 
 void InstantiationInformation::addTemplateParameter(KDevelop::AbstractType::Ptr \
                type) {
-  ///@todo This is C++ specific: Only the un-aliased types play a role for \
                template-parameters
-  ///@todo Do deep un-aliasing. Example: A pointer to an aliased type
-//   templateParametersList().append(TypeUtils::unAliasedType(type)->indexed());
-  templateParametersList().append(type->indexed());
+  ///@todo This is C++ specific: Only the un-aliased types play a role for \
template-parameters, and it's even required to correctly do specialization-matching \
and such +  
+  struct UnAliasExchanger : public KDevelop::TypeExchanger {
+    virtual KDevelop::AbstractType::Ptr exchange(const KDevelop::AbstractType::Ptr& \
type) { +
+      KDevelop::AbstractType::Ptr check = type;
+      
+      KDevelop::TypeAliasType::Ptr alias = type.cast<KDevelop::TypeAliasType>();
+      if(alias)
+        return exchange(alias->type());
+      
+      check->exchangeTypes(this);
+      
+      return check;
+    }
+  };
+  
+  UnAliasExchanger exchanger;
+  
+/*  templateParametersList().append(TypeUtils::unAliasedType(type)->indexed());
+  return;*/
+  
+  if(type)
+    templateParametersList().append(exchanger.exchange(AbstractType::Ptr(type->clone()))->indexed());
 +  else
+    templateParametersList().append(IndexedType());
 }
 
 QString InstantiationInformation::toString(bool local) const {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic