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

Greater than > in template function declaration not parsed correctly #8622

Closed
tttapa opened this issue Jun 25, 2021 · 7 comments
Closed

Greater than > in template function declaration not parsed correctly #8622

tttapa opened this issue Jun 25, 2021 · 7 comments

Comments

@tttapa
Copy link
Contributor

tttapa commented Jun 25, 2021

Consider the following template function declaration and definition:

#pragma once

template <bool>
struct S {};

template <int A, int B>
S<(A > B)> fun();

template <int A, int B>
S<(A > B)> fun() {
    return {};
}

When running Doxygen, this results in the following warning:

header.hpp:10: warning: no matching file member found for 
S<(A >) B fun
Possible candidates:
 'S<(A > B)> fun()' at line 10 of file header.hpp

Interestingly enough, the generated documentation looks correct at first sight, and when removing either the declaration or the definition, Doxygen no longer complains.

Expected behavior
The template being parsed correctly and no warnings being emitted.

To Reproduce
Default Doxyfile with the following changes:

67c67
< EXTRACT_ALL            = NO
---
> EXTRACT_ALL            = YES
266c266
< GENERATE_LATEX         = YES
---
> GENERATE_LATEX         = NO

Doxygen-8622.zip

Version
doxygen 1.9.2 (ff2a7670c50743547495f0ebee35323b11a74e6a), master branch, compiled from source just now, on Ubuntu 20.04.

@albert-github
Copy link
Collaborator

Shouldn't the prototype:

template <int A, int B>
S<(A > B)> fun();

be inside the

template <bool>
struct S {};

so:

template <bool>
struct S {

template <int A, int B>
S<(A > B)> fun();
};

@albert-github albert-github added C/C++ needinfo reported bug is incomplete, please add additional info labels Jun 25, 2021
@tttapa
Copy link
Contributor Author

tttapa commented Jun 25, 2021

The function is just a free function with S as the return type, similar to how you would write non-templated function prototypes:

// prototype
void fun();
// usage ...
void fun() {
   // implementation
}

@albert-github
Copy link
Collaborator

Ah yes now I see, I think that doxygen got a bit confused as well ...

@albert-github albert-github added bug and removed needinfo reported bug is incomplete, please add additional info labels Jun 25, 2021
@tttapa
Copy link
Contributor Author

tttapa commented Jun 25, 2021

To clarify: this is by no means a high-priority bug, the spurious warnings just obscure some of the more important warnings.

@doxygen
Copy link
Owner

doxygen commented Jun 27, 2021

Please verify if the referenced commit fixes the issue.

@tttapa
Copy link
Contributor Author

tttapa commented Jun 27, 2021

That seems to have fixed it, all such warnings have disappeared in my project. Thanks a lot for the quick responses!

@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
ralexe pushed a commit to ralexe/doxygen that referenced this issue Jul 3, 2021
@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