[cfe-dev] libclang python bindings - how to force C++ mode ?

Stefaan Himpe stefaan.himpe at gmail.com
Mon Nov 14 13:54:23 PST 2011


> Try passing "-x c++" to the parser.

Hello, and thanks for replying.

Unfortunately, passing -x c++ doesn't seem to have any effect.

I'm invoking cindex-dump.py as follows:

python cindex-dump.py test.h -x c++

i've also tried

python cindex-dump.py test.h "-x c++"

I've verified with print statements that
the arguments are really passed to the parser
as part of the following code:

index = Index.create()
tu = index.parse(None, args)

where

args = ['test.h', '-x', 'c++'] (first way of invoking)

or

args = ['test.h', '-x c++'] (second way of invoking)

Any other ideas?

Stefaan.




More information about the cfe-dev mailing list