breathe
breathe copied to clipboard
inline constexpr friends inject extra keywords
Steps to reproduce
- Follow Sy Brand's tutorial for setting up Breathe.
- Add the following to
CatCutifier.h
/**
A fluffy feline
*/
struct cat {
/**
Make this cat look super cute
*/
void make_cute();
/// some docs
constexpr friend bool operator==(cat const x, int const y)
{
return true;
}
};
Expected output
constexpr friend bool operator==(cat const x, int const y)
some docs
Actual output
inline friend constexpr friend bool operator== (cat const x, int const y)
some docs
inline
should not be present at all, and friend
should only appear once.
@cjdb Could you also post the Doxygen XML definition for the operator==
, curious to see what I looks like.
Not entirely sure what you're after, so I've bundled everything from my doxygen/xml
. I also checked the HTML and didn't see extra keywords.
xml.zip
I noticed while looking into #917 that friend
is unconditionally being inserted if something is a friend. I'm not sure why it being constexpr
impacts this, but commenting that line out seems to fix it (I haven't tested to see what happens in situations that aren't like the one above yet).
https://github.com/breathe-doc/breathe/blob/bf020a8c284929f48033c0c8fb9de37615d5c0c1/breathe/renderer/sphinxrenderer.py#L1982-L1983
Update: it looks as if friend constexpr
works as intended, but constexpr friend
does not.
Hey everyone, thanks for making a great tool here in Breathe! @vermeeren any chance of getting #918 merged and into a release? It looks like this issue (and #917) have pending fixes that could go in.