-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors with "circular" includes #150
Comments
... I get that this is a bug in the tool, but why do you have two headers that mutual include each other?! |
The example shows the reason why. Both, |
As a compiler author, it's not my place to criticize your code, but why not define it in the source file instead? Or put both classes in the same header? Anyways, I've added a workaround for the issue. |
You are right, this would be the normal way to do it. But, the library is a header-only library.
This would work. But we try to keep one class per file for various reasons. Anyway, the bugfix only solved part of the problem. It still says:
if I pass a relative path to N/A.hpp and
If I pass an absolute path to the file. |
Okay, now I should have fixed it :D |
After fixing #150, after including any standard header like for example #pragma once
#include <string>
static void Dummy(std::string value) {
}
Before this commit the output would be simply:
The dummy function isn't even showing. |
I can't reproduce that using clang 14.0.6 and do not have access to clang 15 at the moment. Can you verify that the issue does not appear when you downgrade to clang 14? |
Ok, I will try with clang14 and get back to you as soon as possible. |
Sorry for the late reply, looks like this issue is occurring with newer versions of clang. |
I have the I then use
My clang version is:
Does that fail for you? What is your clang version? |
I am using |
I will be trying |
Sorry for late reply, because usually like most developers I tend to be careful when updating libraries on my main machine.
Apparently my main issue was solved thought. |
Ok version |
libclang_parser
Hi Jonathan,
thanks for making such a great library. I'm trying to get it running with my code base, but encountered another error.
I have two classes that reference each other. Parsing these files with cppast gives errors as below
Input:
N/A.hpp:
N/B.hpp
Input flags:
-v -I /abs/path/to/base_of_N/ /abs/path/to/N/A.hpp
Output:
The output differs if I pass a relative path to the input file:
Input flags:
-v -I /abs/path/to/base_of_N/ N/A.hpp
Output:
The text was updated successfully, but these errors were encountered: