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

Found ';' while parsing initializer list! for member function pointer #10369

Closed
swiesheier opened this issue Oct 19, 2023 · 10 comments
Closed

Found ';' while parsing initializer list! for member function pointer #10369

swiesheier opened this issue Oct 19, 2023 · 10 comments

Comments

@swiesheier
Copy link

swiesheier commented Oct 19, 2023

I use doxygen 1.9.5 and get

warning: Found ';' while parsing initializer list! (doxygen could be confused by a macro call without semicolon)

for the docu of a member function pointer in c++

    name::ClassB<2, 3, NumberType>(
              ClassA<dim, NumberType>::*myPtr)(const name::ClassB<2,3,NumberType> &foo) const;

If I remove the template brackets for the return type,

    name::ClassB(
                  ClassA<dim, NumberType>::*myPtr)(const name::ClassB<2,3,NumberType> &foo) const;

doxygen treats it as a function and reports


    warning: parameters of member myPtr are not documented
    warning: return type of member myPtr is not documented

Is there a preprocessor trick to work around this issue?

UPDATE:

I attached a minimal example demonstrating the problem!

mwe.cc.tar.gz

@albert-github albert-github added needinfo reported bug is incomplete, please add additional info C/C++ labels Oct 19, 2023
@albert-github
Copy link
Collaborator

Note: current doxygen version is 1.9.8

  • Can you please attach a, small, self contained example (source+configuration file in a, compressed, tar or zip file) that allows us to reproduce the problem? Please don't add external links as they might not be persistent.

@swiesheier
Copy link
Author

@albert-github I added an example that shows the problem.

Unfortunately, I can only use 1.9.5 at the moment.

@albert-github albert-github added bug and removed needinfo reported bug is incomplete, please add additional info labels Oct 19, 2023
@albert-github
Copy link
Collaborator

albert-github commented Oct 19, 2023

I see the warning with the versions 1.9.5, 1.9.8 and the current master (1.10.0 (81b6518)) also these versions have no relevant differences regarding this problem (as far as I can see quickly)

@swiesheier
Copy link
Author

swiesheier commented Oct 19, 2023

I see the warning with the versions 1.9.5, 1.9.8 and the current master (1.10.0 (81b6518)) also these versions have no relevant differences regarding this problem (as far as I can see quickly)

So there is no solution for this problem at the moment?

Interestingly, maybe this helps, if the return type of the function is changed to void, the warning does not show up. So the problem might be related to the scope resolution operator (::) that comes before the first bracket (.

@albert-github
Copy link
Collaborator

Interesting observation, might have to do with the handling of the < and > of the test::Foo<3,NumberType> of the line test::Foo<3,NumberType>(Foo<dim, NumberType>::*funcPtr)(

@swiesheier
Copy link
Author

I do not know.

Do you have a clue for a solution?

@albert-github
Copy link
Collaborator

It is a difficult problem especially due to all the new "improvements" in the different standards that complicate things here (and also for compiler builders etc.) .

@doxygen
Copy link
Owner

doxygen commented Oct 21, 2023

The easiest workaround (that also helps to make the code more readable) is to define a type, e.g.

            /** Name for this type */
            using ThisType = Foo<dim,NumberType>;
            /** 3D Type */
            using Type3D = Foo<3,NumberType>;

            /**
            * Pointer to member func 1
            */
            Type3D(ThisType::*funcPtr)(const Type3D &arg1) const;

doxygen added a commit that referenced this issue Oct 21, 2023
@doxygen
Copy link
Owner

doxygen commented Oct 21, 2023

@swiesheier Please verify if the referenced commit fixes the problem for you. Do not close the issue, this will be done automatically when the next official version is released.

@doxygen doxygen added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Oct 21, 2023
@doxygen
Copy link
Owner

doxygen commented Dec 25, 2023

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.10.0.
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 Dec 25, 2023
@doxygen doxygen closed this as completed Dec 25, 2023
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