jessevdk / cldoc

clang based documentation generator for C and C++
GNU General Public License v2.0
552 stars 58 forks source link

'friend class Bar' causes "ValueError: Unknown template argument kind 603" #129

Closed troelsfr closed 6 years ago

troelsfr commented 6 years ago

Following code:

class Bar;

class Foo {
  int x;
  friend class Bar;
};

class Bar {
  void apply(Foo &foo) { foo.x = 2; }
};

gives following error message:

$ cldoc generate --std=c++11 -- --output Docs/ test.hpp 
Processing test.hpp
Traceback (most recent call last):
  File "/opt/local/bin/cldoc", line 4, in <module>
    run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cldoc-1.9-py2.7.egg/cldoc/__init__.py", line 57, in run
    run_generate(rest)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cldoc-1.9-py2.7.egg/cldoc/__init__.py", line 27, in run_generate
    cmdgenerate.run(args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cldoc-1.9-py2.7.egg/cldoc/cmdgenerate.py", line 125, in run
    t.process()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cldoc-1.9-py2.7.egg/cldoc/tree.py", line 212, in process
    self.visit(tu.cursor.get_children())
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cldoc-1.9-py2.7.egg/cldoc/tree.py", line 517, in visit
    self.visit(item.get_children(), node)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cldoc-1.9-py2.7.egg/cldoc/tree.py", line 483, in visit
    if item.kind == cindex.CursorKind.UNEXPOSED_DECL:
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cldoc-1.9-py2.7.egg/cldoc/clang/cindex.py", line 1292, in kind
    return CursorKind.from_id(self._kind_id)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cldoc-1.9-py2.7.egg/cldoc/clang/cindex.py", line 574, in from_id
    raise ValueError,'Unknown template argument kind %d' % id
ValueError: Unknown template argument kind 603

I am using the latest checkout on a Mac with Python 2.7

petabytestorage commented 6 years ago

i was stuck on this too; i've made a workaround for the problem as well as a fix for the ubuntu libclang.so filename issue in my fork at https://github.com/petabytestorage/cldoc

jessevdk commented 6 years ago

This should be resolved now.