-
Notifications
You must be signed in to change notification settings - Fork 363
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
API check: Method defined in header file, but out of class, marked as undocumented #1544
Comments
Hi @jspam, thanks for providing this sample. I see two possible solutions:
Regards, |
I think ignoring all class A {
public:
inline void f();
}
inline void A::f() {} A symbol table would of course be a more elegant solution, but I agree it is more complicated, especially since you have to take into account A simple approach could be to ignore a function definition with a qualified name that is outside the class or namespace it belongs to. (Ignoring just function definitions with a qualified name would probably work too, but GCC accepts The drawback is that the following code would still be marked as undocumented although Doxygen accepts it. However, the code is already marked as undocumented at the moment and I guess it is more common to document a function at the definition rather than at the declaration. class A {
public:
void f();
}
/** Documented */
inline void A::f() {} |
@ivangalkin I also tend to use your symbol table implementation. Can you rebase it please. |
@guwirth done |
@jspam a possible "fast" workaround could be class A {
public:
/** Documented */
void f();
}
/** @copydoc A::f */
inline void A::f() {} |
closed, see #1580 |
Description
A method that is declared and documented inside a class, but defined outside the class in the header file, is marked as undocumented API.
PR #1543 contains an example of such a definition.
In Doxygen, the documentation is correctly taken from the definition inside the class.
Steps to reproduce the problem
Analyze
public_api.h
from #1543 with sonar-cxxExpected behavior
The method definition in line 111 (
inline void testClass::publicDeclaredMethod() {
) is not marked as undocumented.Actual behavior
The method definition in line 111 is marked as undocumented (
Undocumented API: testClass
).LOG file
Related information
The text was updated successfully, but these errors were encountered: