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 759242 - Doxygen parser confused by less-than in default template argument
Doxygen parser confused by less-than in default template argument
Status: RESOLVED OBSOLETE
Product: doxygen
Classification: Other
Component: general
1.8.10
Other Linux
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
[moved_to_github]
Depends on:
Blocks:
 
 
Reported: 2015-12-09 12:40 UTC by Jonathan Wakely
Modified: 2018-07-30 10:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jonathan Wakely 2015-12-09 12:40:47 UTC
namespace ns
{

  template<size_t Nb, bool = Nb < 32>
    struct test
    {
    };

  /**
   *  @brief blah blah
  */
  template<size_t Nb>
    class foo
    { };

} // namespace ns

The code  above produces the bogus warning:

/tmp/doxygen/foo.h:10: warning: Ignoring @brief command inside argument documentation

The parser thinks N < 32 is the start of a template-id rather than a relational-expression.


Doxygen should really stop trying to use its own incomplete and incorrect parser and switch to libclang.
Comment 1 Dimitri van Heesch 2015-12-20 09:46:43 UTC
Note that this can easily be worked around by using:

 template<size_t Nb, bool = (Nb < 32)>
    struct test
    {
    };

which is already a bit friendlier to anyone that needs to read the code
Comment 2 Jonathan Wakely 2015-12-20 12:42:53 UTC
Yes that's exactly what I had to do, but it's not required by C++ and I don't think it helps readers either. A human reader is going to understand Nb < 32 without any help, because Nb is obviously an integer (it's defined just a few characters earlier on the same line!) and Nb < 32 is a very straightforward boolean expression.

We should not have to change our coding style to use doxygen.
Comment 3 André Klapper 2018-07-30 10:55:39 UTC
As discussed in https://github.com/doxygen/doxygen/pull/734 , Doxygen has moved its issue tracking to 

   https://github.com/doxygen/doxygen/issues

All Doxygen tickets in GNOME Bugzilla have been migrated to Github. You can subscribe and participate in the new ticket in Github. You can find the corresponding Github ticket by searching for its Bugzilla ID (number) in Github.

Hence I am closing this GNOME Bugzilla ticket.
Please use the corresponding ticket in Github instead. Thanks a lot!