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
Breathe fails to parse std::function typedef #291
Comments
Could you check if this problem still exists with latest Sphinx (1.7.5) + Breathe (4.9.0)? Support for C++ has been vastly improved since the issue was opened. |
With Sphinx 1.7.5 and Breathe 4.9.1, I get the following error:
The offending code is no longer part of my project, here is the reproduction code I used: // test.hpp
#include <functional>
#include <memory>
namespace chemfiles {
class Format;
/// Test
typedef std::function<std::unique_ptr<Format>(void)> function_type;
} .. test.rst
.. doxygentypedef:: chemfiles::function_type |
With the code above from @Luthaf it looks like the missing opening parenthesis is already missing in the Doxygen XML. |
I did a quick search through the Doxygen bug tracker. https://bugzilla.gnome.org/query.cgi?format=advanced&product=doxygen But could not find an issue for this. Next steps will be opening a bug upstream, ref to it form here. Then probably implement a workaround specifically for |
The doxygen output looks good AFAICJ: <?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.15">
<compounddef id="test_8cpp" kind="file" language="C++">
<compoundname>test.cpp</compoundname>
<includes local="no">functional</includes>
<includes local="no">memory</includes>
<incdepgraph>
<node id="1">
<label>functional</label>
</node>
<node id="0">
<label>test.cpp</label>
<link refid="test_8cpp"/>
<childnode refid="1" relation="include">
</childnode>
<childnode refid="2" relation="include">
</childnode>
</node>
<node id="2">
<label>memory</label>
</node>
</incdepgraph>
<innernamespace refid="namespacechemfiles">chemfiles</innernamespace>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/><functional></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><memory></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="keyword">namespace<sp/></highlight><highlight class="normal"><ref refid="namespacechemfiles" kindref="compound">chemfiles</ref><sp/>{</highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal">Format;</highlight></codeline>
<codeline lineno="7"><highlight class="keyword">typedef</highlight><highlight class="normal"><sp/>std::function<std::unique_ptr<Format>(void)><sp/>function_type;</highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight></codeline>
<codeline lineno="9"><highlight class="normal">}</highlight></codeline>
</programlisting>
<location file="test.cpp"/>
</compounddef>
</doxygen> and sphinx 1.7.5 also handles .. cpp:type:: function_type = std::function<std::unique_ptr<Format>(void)> properly. |
It is likely this has been fixed somewhere at some point, likely in Doxygen. Assuming fixed for now, comment if not the case. |
If I have code containing a std::function typedef containing a template return parameter:
Then I get an error from breathe:
The error goes away if I use a non-template return type (
int
, ...). It looks like the opening parentheses is being eaten somewhere.The text was updated successfully, but these errors were encountered: