After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759247 - C++11 unified initializer for array with templates treated as function
C++11 unified initializer for array with templates treated as function
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.8.10
Other All
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2015-12-09 13:39 UTC by Freddie Chopin
Modified: 2015-12-30 10:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Freddie Chopin 2015-12-09 13:39:36 UTC
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<int>(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.
Comment 1 Dimitri van Heesch 2015-12-13 10:46:12 UTC
Confirmed. Should be fixed in the next GIT update.
Comment 2 Freddie Chopin 2015-12-13 11:55:49 UTC
Great - thanks! (;
Comment 3 Dimitri van Heesch 2015-12-30 10:19:33 UTC
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).