Skip to content

Inner structure/class declared by macro, "no matching class member found for" #9857

Closed
@iljamaki

Description

@iljamaki

doxygen 1.9.6 with clang support 13.0.0.

Code:

//! \brief  Macro for declaring a new inner structure
#define DECLARE_INNER( _NAME ) \
struct _NAME \
    : public Inner \
{ \
    explicit _NAME( int a ) : Inner( a ) {} \
    void foo( ) override; \
}

//! \brief  class A
class A
{
public:
    //! \brief  Inner
    struct Inner
    {
        //! \brief  The constructor
        explicit Inner( int a, int b = 0 );

        //! \brief  Do the foo
        virtual void foo( ) = 0;
    };

    DECLARE_INNER( TwoInherited );
};

A::Inner::Inner( int a, int b )
{
}

void A::TwoInherited::foo( )
{
}

Doxygen output with configuration generated by doxygen -g

A.cpp:31: warning: no matching class member found for
  void A::TwoInherited::foo()
Possible candidates:
  'virtual void A::Inner::foo()=0' at line 21 of file A.cpp
  
A.cpp:24: warning: Member DECLARE_INNER(TwoInherited) (function) of class A is not documented.

Expected: No complaints as the code is completely valid. A::Inner::foo is documented and the same documentation should be applied to any overrides without repetition. The only thing you could argue is that TwoInherited constructor is not documented, but that doxygen does not complain about. In a perfect world you could even document that inside the macro definition and doxygen would get the documentation there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C/C++UsageThe mentioned problem is not a doxygen problem but due to usage of a feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions