-
Notifications
You must be signed in to change notification settings - Fork 58
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
Cpp clean tells me I need to #include something that I can forward declare. #60
Comments
I can't reproduce this:
|
My examples wasn't good. I'll need to look further into this to work out what's going on, but may not have time. My project is very large so it could be very difficult to reduce it to a Minimal, Complete, and Verifiable example |
I've got this kind of behaviour in specific templates.
QPointer stores a pointer, it doesn't need access to Data implementation. |
Would something that was forward declared but needs to be included even compile? |
The following might help. This works: class MyCoolClass;
int do_something(MyCoolClass * ptr); but this raises class MyCoolClass;
template <typename T>
T do_something(MyCoolClass * ptr)
{
// whatever
return 0;
} |
Consider the following:
Cppclean thinks that I need to #include "blah.h" even though I'm only using it in pointer form:
"Foo.h:1: 'Blah' forward declared, but needs to be #included"
The code compiles fine with the forward declare.
The text was updated successfully, but these errors were encountered: