[cfe-dev] Issues with traversal

Stefaan Himpe stefaan.himpe at gmail.com
Tue Dec 6 14:13:23 PST 2011


> /usr/include/c++/4.4.4/bits/postypes.h:214:12: error: unknown type name 'bool'
>      inline bool
>               ^

Filenames that end in .h are parsed in c-mode (as opposed to c++ mode) 
by default leading to such errors.

You can force c++ mode by passing "-x c++" to the parser, followed by 
the files you want to parse in c++ mode. (Alternatively you can rename a 
.h file to a .hpp file, but given that you are using system header 
files, that probably is a bad idea).

Note: just passing on what someone told me a few weeks ago. I'm by no 
means an expert. It worked for me though.

HTH,
Stefaan.




More information about the cfe-dev mailing list