diff --git a/breathe/renderer/sphinxrenderer.py b/breathe/renderer/sphinxrenderer.py index dff0c982..f2efefa7 100644 --- a/breathe/renderer/sphinxrenderer.py +++ b/breathe/renderer/sphinxrenderer.py @@ -1975,27 +1975,26 @@ def visit_function(self, node) -> List[Node]: ) else: elements = [self.create_template_prefix(node)] + # TODO: handle constexpr when parser has been updated + # but Doxygen seems to leave it in the type anyway + typ = "".join(n.astext() for n in self.render(node.get_type())) + # Doxygen sometimes leaves 'static' in the type, + # e.g., for "constexpr static auto f()" + typ = typ.replace("static ", "") if node.static == "yes": elements.append("static") if node.inline == "yes": elements.append("inline") if node.kind == "friend": + # In Doxygen up to somewhere between 1.8.17 to exclusive 1.9.1 + # the 'friend' part is also left in the type. + # See also: #767, #919 + typ = re.sub(r"(^|\s+)friend(\s+)", r"\1\2", typ) elements.append("friend") if node.virt in ("virtual", "pure-virtual"): elements.append("virtual") if node.explicit == "yes": elements.append("explicit") - # TODO: handle constexpr when parser has been updated - # but Doxygen seems to leave it in the type anyway - typ = "".join(n.astext() for n in self.render(node.get_type())) - # Doxygen sometimes leaves 'static' in the type, - # e.g., for "constexpr static auto f()" - typ = typ.replace("static ", "") - # In Doxygen up to somewhere between 1.8.17 to exclusive 1.9.1 - # the 'friend' part is also left in the type. - # See also #767. - if typ.startswith("friend "): - typ = typ[7:] elements.append(typ) elements.append(name) elements.append(node.get_argsstring())