GNOME Bugzilla – Bug 759242
Doxygen parser confused by less-than in default template argument
Last modified: 2018-07-30 10:55:39 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.
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
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.
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!