Cldoc crashes on a partial specialization template

This question was marked as incomprehensible by what I ask. For clarity, I ask for a workaround for this document generator to work properly against my code base. (perhaps splitting a task into batches? Is this possible with cldocs? Perhaps you have chosen different command line options? Perhaps my call is incorrect or erroneous?)

I registered a bug in the project, which you can find here, with additional information about my environment (including the full command line located here: http://pastebin.com/JxWf9hRB ).

https://github.com/jessevdk/cldoc/issues/73

The original question:

I am studying using cldocs for automatic documentation. However, it crashed into my code base with the following error:

Traceback (most recent call last):
  File "/usr/local/bin/cldoc", line 9, in <module>
    load_entry_point('cldoc==1.6', 'console_scripts', 'cldoc')()
  File "/usr/local/lib/python2.7/site-packages/cldoc/__init__.py", line 57, in run
    run_generate(rest)
  File "/usr/local/lib/python2.7/site-packages/cldoc/__init__.py", line 27, in run_generate
    cmdgenerate.run(args)
  File "/usr/local/lib/python2.7/site-packages/cldoc/cmdgenerate.py", line 151, in run
    run_generate(t, opts)
  File "/usr/local/lib/python2.7/site-packages/cldoc/cmdgenerate.py", line 33, in run_generate
    generator.generate(xmlout)
  File "/usr/local/lib/python2.7/site-packages/cldoc/generators/xml.py", line 55, in generate
    Generator.generate(self, outdir)
  File "/usr/local/lib/python2.7/site-packages/cldoc/generators/generator.py", line 22, in generate
    self.generate_node(node)
  File "/usr/local/lib/python2.7/site-packages/cldoc/generators/xml.py", line 543, in generate_node
    self.generate_page(node)
  File "/usr/local/lib/python2.7/site-packages/cldoc/generators/xml.py", line 510, in generate_page
    elem = self.node_to_xml(node)
  File "/usr/local/lib/python2.7/site-packages/cldoc/generators/xml.py", line 496, in node_to_xml
    chelem = self.node_to_xml(child)
  File "/usr/local/lib/python2.7/site-packages/cldoc/generators/xml.py", line 485, in node_to_xml
    self.call_type_specific(node, elem, 'to_xml')
  File "/usr/local/lib/python2.7/site-packages/cldoc/generators/xml.py", line 465, in call_type_specific
    getattr(self, nm)(node, elem)
  File "/usr/local/lib/python2.7/site-packages/cldoc/generators/xml.py", line 273, in method_to_xml
    if len(node.override) > 0:
  File "/usr/local/lib/python2.7/site-packages/cldoc/nodes/method.py", line 43, in override
    bases = list(self.parent.bases)
AttributeError: 'Namespace' object has no attribute 'bases'

EDIT:

.

template<typename T>
struct Foo {
  int baz(T const& t) const { }
};

template<typename T, int N>
class Bar { };

template<typename T, int N>
struct Foo<Bar<T, N>> {
  int baz(Bar<T, N> const& a) const;
};

template<typename T, int N>
int Foo<Bar<T, N>>::baz(Bar<T, N> const& a) const { }

:

template<typename T>
struct Foo {
  int baz(T const& t) const { }
};

template<typename T, int N>
class Bar { };

template<typename T, int N>
struct Foo<Bar<T, N>> {
  int baz(Bar<T, N> const& a) const { }
};
+4
1

cldoc clang , C/++ (, -std=c++11).

, . , . , Foo<Bar<T, N>>::baz() , self.parent Root Namespace (, , "" ), Class , bases .

, "" self.parent . , , . , , , , .

:

diff --git a/cldoc/nodes/method.py b/cldoc/nodes/method.py
index f910241..3e1208f 100644
--- a/cldoc/nodes/method.py
+++ b/cldoc/nodes/method.py
@@ -40,7 +40,7 @@ class Method(Function):
             return self._override

         # Lookup in bases, recursively
-        bases = list(self.parent.bases)
+        bases = list(getattr(self.parent, "bases", []))
         mname = self.name

         self._override = []
+1

All Articles