The Wayback Machine - https://web.archive.org/web/20230615224715/https://github.com/doxygen/doxygen/issues/8620
Skip to content
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

Missing parameter in C++ methods #8620

Closed
couet opened this issue Jun 25, 2021 · 8 comments
Closed

Missing parameter in C++ methods #8620

couet opened this issue Jun 25, 2021 · 8 comments

Comments

@couet
Copy link
Contributor

couet commented Jun 25, 2021

Describe the bug

In our project we have code structures similar to:

File AB.cxx:

/// \class A
/// Class A
class A {
public:
   /// method 1 in A
   void method1(int i){}
};


/// \class B
/// Class B
class B : public A {
public:
   using A::method1;
   /// method 1 in B
   void method1(int i){}
   /// method 2
   void method2(int i){}
};

The following screenshot is what I get for "class B" . As you can see the parameter for method1 defined in class A is missing in the detailed documentation.

Expected behavior

We would like to see the parameter for method1() in the class B detailed documentation.

Screenshots

Screenshot 2021-06-25 at 10 52 47

Version
1.9.0 and 1.9.2

@albert-github
Copy link
Collaborator

I'm not sure whether the method1 from A should be mentioned as a member function or as an inherited member, currently both mentions are present.

The fact that the parameter is missing in the detailed description is, as far as I can see, the result from the fact that the scope of using is not taken into account in the (function MemberDefImpl::writeDocumentation in file memberdef.cpp:

      const Definition *scope = cd;
      if (scope==0) scope = nd;
      hasParameterList=writeDefArgumentList(ol,scope,this);

for both method1 the scope->name() is here B from the class cd but for the method1 from class A the actual scope is probably A and is for that reason probably not matched.

@doxygen how to handle?

@doxygen
Copy link
Owner

doxygen commented Jun 27, 2021

In the example the using A::method1 doesn't do anything it seems. Clients of class B can already invoke B::method1 without the using statement, because the method is inherited from A. I can imagine this can be useful in case the method in class A is protected, and in class B one wants to expose it as a public method without adding a forwarding wrapper method. I think in this case, doxygen should show the method as a public method of class B. So what needs to be fixed is show the parameter list, as is requested.

@doxygen
Copy link
Owner

doxygen commented Jun 27, 2021

Look like a copy'n'paste mistake where the template argument list was assigned instead of the method's argument list 🙄.
Please verify if the attached commit fixes the problem.

@albert-github albert-github added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Jun 27, 2021
@albert-github
Copy link
Collaborator

From my tests it looks like the problem has been solved.

@couet
Copy link
Contributor Author

couet commented Jun 28, 2021

I installed the master version to try if it was solved. But I get the following. The "Member function Documentation" is missing:

Screenshot 2021-06-28 at 08 53 27

@couet
Copy link
Contributor Author

couet commented Jun 28, 2021

Indeed I see this is a new behaviour. The "Member function Documentation" is generated only if the help of the function contains more than just a "\brief" (or equivalent) . With the following code:

// \class A
/// Class A
class A {
public:
   /// method 1 in A
   void method1(int i){}
};


/// \class B
/// Class B
class B : public A {
public:
   using A::method1;
   /// method 1 in B.
   /// The is more help for method 1 in B.
   void method1(int i){}
   /// method 2 in B.
   /// The is more help for method 2 in B.
   void method2(int i){}
};

I get:

Screenshot 2021-06-28 at 09 13 37

Which is now correct. We can see the correct parameters' list.
Thanks for fixing it.

@doxygen
Copy link
Owner

doxygen commented Jun 28, 2021

@couet Alternatively, you can enable ALWAYS_DETAILED_SEC in the configuration file.

@doxygen
Copy link
Owner

doxygen commented Aug 18, 2021

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.9.2.
Please verify if this is indeed the case. Reopen the
issue if you think it is not fixed and please include any additional information
that you think can be relevant (preferably in the form of a self-contained example).

@doxygen doxygen removed the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Aug 18, 2021
@doxygen doxygen closed this as completed Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants