GNOME Bugzilla – Bug 759281
Doxygen parser confused by C++11 attributes
Last modified: 2016-09-30 19:07:55 UTC
Doxygen doesn't have any way to document unnamed parameters, but giving them a name leads to compiler warnings. An obvious solution is to name the parameter but mark it unused, but doxygen can't cope with that either: /// S is a class struct S { /** @brief blah blah * @param i an unused argument */ void f(int i [[gnu:unused]]) { } }; /tmp/doxygen/include/un.cpp:4: warning: argument 'i' of command @param is not found in the argument list of S::f(int i][[gnu:unused]) There's no warning if the code looks like this: void f(int [[gnu:unused]] i) { } But that's not the right syntax, because there the attribute applies to the type, not the parameter. Again, Doxygen should use a conforming parser such as libclang, rather than maintaining its own.
I'll add support for C++11 style attributes. Should be fixed in the next GIT update. I agree that using libclang for C++ parser support would be an improvement, but it is not so easy and the last time I looked the API had blocking limitations (partial code parsing, macros, typedef handling...)
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).
What happens with the C++11 attribute? Is it stored in e.g the XML output? I'd like to include it in the output. $cat test.h [[ threadsafe ]] MyFunc(); echo "GENERATE_XML = YES" | doxygen - gives <?xml version='1.0' encoding='UTF-8' standalone='no'?> <doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.13"> <compounddef id="test_8h" kind="file" language="C++"> <compoundname>test.h</compoundname> <sectiondef kind="func"> <memberdef kind="function" id="test_8h_1a81f2b307f2171fc964cf96a04341579a" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type></type> <definition>MyFunc</definition> <argsstring>()</argsstring> <name>MyFunc</name> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="test.h" line="1" column="1"/> </memberdef> </sectiondef> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <programlisting> <codeline lineno="1"><highlight class="normal">[[<sp/>threadsafe<sp/>]]<sp/>MyFunc();</highlight></codeline> </programlisting> <location file="test.h"/> </compounddef> </doxygen>