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

List:       kde-commits
Subject:    kdesupport/cpptoxml/parser
From:       Peter Kümmel <syntheticpp () yahoo ! com>
Date:       2008-08-21 20:23:55
Message-ID: 1219350235.189137.16551.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 850608 by kuemmel:

fix parser bug with template specialisations

 M  +10 -2     binder.cpp  


--- trunk/kdesupport/cpptoxml/parser/binder.cpp #850607:850608
@@ -416,8 +416,11 @@
 void Binder::visitTemplateDeclaration(TemplateDeclarationAST *node)
 {
     const ListNode<TemplateParameterAST*> *it = node->template_parameters;
-    if (it == 0)
+    if (it == 0) {
+        // needed for template specialisation (template<> class K<void>)
+        visit(node->declaration);
         return;
+    }
 
     TemplateParameterList savedTemplateParameters = changeTemplateParameters(TemplateParameterList());
 
@@ -609,6 +612,11 @@
   ClassCompiler class_cc(this);
   class_cc.run(node);
 
+  if (class_cc.name().endsWith('>') && !class_cc.name().contains('<')) {
+	  // TODO parser bug in case of template<> Class<8>
+	  return;
+  }
+
   if (class_cc.name().isEmpty())
     {
       // anonymous not supported
@@ -866,7 +874,7 @@
 
           if (ClassModelItem klass = model_dynamic_cast<ClassModelItem> (scope))
             {
-              foreach (const QString& base, klass->baseClasses ())
+              foreach (QString base, klass->baseClasses ())
                 {
                   QStringList ctx = context;
                   ctx.removeLast();
[prev in list] [next in list] [prev in thread] [next in thread] 

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