From dbd996d27a0fbc59ebeaf3ce969c0ca3d364ab91 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Sun, 28 Nov 2021 20:52:47 +0100 Subject: [PATCH] Fix friend functions for older Doxygen versions --- CHANGELOG.rst | 2 ++ breathe/renderer/sphinxrenderer.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 51265498..c20388c6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -24,6 +24,8 @@ Inspired by `Keepachangelog.com `__. - Add :confval:`breathe_show_include` to control whether ``#include`` lines are shown. Defaults to ``True``. `#725 `__ + - Fix friend functions for older Doxygen versions. + `#767 `__ - 2021-09-14 - **Breathe v4.31.0** diff --git a/breathe/renderer/sphinxrenderer.py b/breathe/renderer/sphinxrenderer.py index 6c3d3887..0f3c289d 100644 --- a/breathe/renderer/sphinxrenderer.py +++ b/breathe/renderer/sphinxrenderer.py @@ -1923,6 +1923,11 @@ def visit_function(self, node) -> List[Node]: # 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())