mosra / m.css

A no-nonsense, no-JavaScript CSS framework, site and documentation theme for content-oriented websites
https://mcss.mosra.cz
Other
406 stars 92 forks source link

Doxygen: `friend` keyword sneaks through as part of the type for `constexpr` operators #225

Closed marzer closed 2 years ago

marzer commented 2 years ago

Hola,

Found this during my investigations into this issue. If you have a 'hidden friend' operator implementation that is also constexpr, e.g.:

struct date
{
    uint16_t year;
    uint8_t month;
    uint8_t day;

    /// \brief  Equality operator.
    friend constexpr bool operator==(const date& lhs, const date& rhs) noexcept
    {
        return lhs.year == rhs.year && lhs.month == rhs.month && lhs.day == rhs.day;
    }

};

the friend keyword leaks into the type, e.g.:

image

The same doesn't occur when the operator isn't constexpr, e.g.:

image

I'm not sure if it also occurs with regular, non-operator functions, since the toml++ codebase only uses friend in this way for operators, but given that the doxygen XML doesn't appear to discriminate between them in any special way I suspect it would occur for regular friend functions, too.

Here's the XML for this particular example: structtoml_1_1date.xml.txt

This was generated by Doxyen 1.9.2 and m.css @ 6f5c7d5 (current at time of writing).