14

I'm looking for a way to suppress doxygen warnings about undocumented member functions, but without using //! @cond and //! @endcond, so the member functions still appear in the synopsis of the class. Something like the following:

class Foo
{
public:
    Foo();
    Foo(const Foo&);
    Foo& operator=(const Foo&);
};

These member functions do the obvious thing and don't need documentation, but I still want them to appear in the list of available member functions in the documentation (because knowing that a class is copyable/assignable matters). As is, doxygen emits a "not documented" warning for each of these. If I use //! @cond and //! @endcond, the methods disappear completely from the documentation. What I would like is for the methods to remain visible in the documentation, but without any further comments, and I want oxygen to not complain about them being undocumented.

Is there some kind of "dummy comment" to tell doxygen to shut up about the lack of doc, but still preserve the methods in the documentation, so they are visible?

2
  • Is the configuration variable WARN_IF_UNDOCUMENTED what you are looking for? Set this to NO and Doxygen will not issue these warnings. You may also need to set EXTRACT_ALL to YES.
    – Chris
    Commented Jun 7, 2013 at 21:34
  • 1
    That's not quite what I'm after. I want to suppress the warning for just a few methods, but keep the warning for other undocumented methods. In essence, what I'd like is something like //! @nowarn and //! @endnowarn. That way, I could have a silent build without lots of warnings, but still get alerted to methods that should be documented but are not. Commented Jun 8, 2013 at 3:52

1 Answer 1

12

You just need to add brackets. This works for me:

//! \{
const int myVar3 = 3;
const int myVar4 = 3;
//! \}

There is no warning and it still appears in the output. You may alias this commants to \nowarn and \endnowarn if you like.

2
  • Excellent! This is genius. Commented Oct 13, 2016 at 17:36
  • You can also use /// instead of //!, which I find easier to type.
    – Chris K
    Commented Apr 2, 2019 at 14:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.