Question

i have recently compiled new clang(3.1 now), and tried to use it for parsing my project, however it fails at parsing standard libraries/includes... for example i see following errors:

/usr/include/c++/4.4/cstddef:51:9: error: expected ';' after top level declarator or /usr/include/c++/4.4/bits/cpp_type_traits.h:71:3: error: unknown type name 'template'

Obviously clang cannot parse this files, but these are standard libstc files ..what should i do with this?

Was it helpful?

Solution

Ok, i have my own answer: First, i hadn't introduced properly the problem. I was using libclang library, not the compiler itself. Second the solution is to force always c++ language, when you parse c++ code, since the parser itself sometimes decides, that he is parsing c code, even if its c++ code.

the solution is, to pass -xc++ argument to the parser.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top