jessevdk / cldoc

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

Circular dependency issue with #pragma once #57

Open jjrv opened 10 years ago

jjrv commented 10 years ago

I've got a class.h and a class-inl.h with its inline functions. #pragma once seems to have problems if class.h includes class-inl.h at the end. To successfully parse class-inl.h when cldoc runs clang on it, it must include class.h creating a circular dependency. When cldoc processes class.h, #pragma once is ignored because it's the main file. Then class-inl.h includes it again and clang fails to parse.

This has been discussed before in issue #4.

A workaround is to not have cldoc parse class-inl.h files and place no documentation there. Then the #include class.h can be removed from them.