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

C++11 unified initializer for array with templates treated as function (Origin: bugzilla #759247) #5910

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity normal in component general for ---
Reported in version 1.8.10 on platform Other
Assigned to: Dimitri van Heesch

On 2015-12-09 13:39:36 +0000, Freddie Chopin wrote:

Following is a contents of a file that defines an array with C++11 unified initialization

--- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 ---

/// \file

/// C++11 array definition
extern "C" int coreVectors[] {some_template(0), 0,};

--- >8 --- >8 --- >8 --- >8 --- >8 --- >8 --- >8 ---

When parsed by doxygen, this is treated as a definition of function "some_template< int >" returning "int coreVectors[]".

If there is no >extern "C"<, then the output is correct. It is also correct if there is no template used in initializer. If unified initialization is not used (so there's a "=" between "[]" and "{") the output is correct.

If you reverse the order of elements in the array (template is not the first item), then the coreVectors[] is detected as a variable (but the values are not included in the documentation), and there also appears an undocumented entry for "some_template< int > (0)" as a function.

The use case that lead me to this problem is using C++-style cast - like reinterpret_cast<>() - in initializer of array.

On 2015-12-13 10:46:12 +0000, Dimitri van Heesch wrote:

Confirmed. Should be fixed in the next GIT update.

On 2015-12-13 11:55:49 +0000, Freddie Chopin wrote:

Great - thanks! (;

On 2015-12-30 10:19:33 +0000, Dimitri van Heesch wrote:

This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.11. Please verify if this is indeed the case. Reopen the
bug 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 closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment