doxygen为基类函数生成了一个奇怪的错误

发布于 2025-01-30 16:04:33 字数 893 浏览 4 评论 0原文

这是代码:

namespace Test {
/// Base class
class Base
{
public:
    /// Method foo
    /// @param a ParamA
    /// @param b ParamB
    virtual void foo(char a, int b);

    /// Method foo
    /// @param a ParamA
    /// @param b ParamB
    /// @param c ParamC
    virtual void foo(char a, int b, char c);

    /// Method foo
    /// @param m ParamM
    template<typename T>
    void foo(std::vector<T> m)
    {

    }

};

/// Derived class
class Derived : public Base
{
public:
    using Base::foo;

    /// Method foo
    /// @param a ParamA
    /// @param b ParamB
    void foo(char a, int b) override;
}; 
}

如果将使用doxygen处理此代码。我们得到奇怪的错误:

错误:在test :: derived :: foo(typeName t)的参数列表中找不到命令@param的参数'm'(警告被视为错误,立即中止)

如果使用base 使用base :: foo; doxygen正确处理此文件。

看起来像Doxygen中的错误,但是有人知道解决方案吗?

Here is the code:

namespace Test {
/// Base class
class Base
{
public:
    /// Method foo
    /// @param a ParamA
    /// @param b ParamB
    virtual void foo(char a, int b);

    /// Method foo
    /// @param a ParamA
    /// @param b ParamB
    /// @param c ParamC
    virtual void foo(char a, int b, char c);

    /// Method foo
    /// @param m ParamM
    template<typename T>
    void foo(std::vector<T> m)
    {

    }

};

/// Derived class
class Derived : public Base
{
public:
    using Base::foo;

    /// Method foo
    /// @param a ParamA
    /// @param b ParamB
    void foo(char a, int b) override;
}; 
}

If this code will be processed with Doxygen. We get the strange error:

Error: argument 'm' of command @param is not found in the argument list of Test::Derived::foo(typename T) (warning treated as error, aborting now)

If commenting line using Base::foo; the Doxygen correctly processing this file.

Looks like a bug in Doxygen, but is anybody know a workaround for that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

此生挚爱伱 2025-02-06 16:04:33
  • 使用Doxygen 1.9.1(包含在内)的Doxygen版本,我能够重现问题。
  • 该版本的1.9.2及更高版本消失了。

当前的doxygen版本是1.9.4(5D15657A555555E6181A7830A5C723AF75E7577E2)

此问题的解决方案是将您的doxygen版本更新为当前doxygen版本。

  • With the doxygen versions till doxygen 1.9.1 (inclusive) I was able to reproduce the problem.
  • The problem is gone with the versions 1.9.2 and higher.

The current doxygen version is 1.9.4 (5d15657a55555e6181a7830a5c723af75e7577e2)

The solution for this problem is to update your doxygen version to the current doxygen version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文