【问题标题】:How to report this ICE for gcc-trunk如何为 gcc-trunk 报告这个 ICE
【发布时间】:2017-07-04 18:25:18
【问题描述】:

我想让这段代码工作

#include <cstddef>

template <bool B, auto T, auto F>
struct conditional { static constexpr auto value = T; };

template <auto T, auto F>
struct conditional<false, T, F> { static constexpr auto value = F; };

template <std::size_t N, auto... Dims>
struct static_extent;

template <std::size_t N>
struct static_extent<N> {
   static constexpr std::size_t value = 0;
};

template <std::size_t N, auto Dim, auto... Dims>
struct static_extent<N, Dim, Dims...> {
  static constexpr auto value =
     conditional<
        (N == 0),
        Dim,
        static_extent<N-1, Dims...>::value
     >::value;
};

enum class dynamic_extent_tag {};
inline constexpr dynamic_extent_tag dyn{-1};

int main()
{
    static_assert(static_extent<1, 33, dyn, 19>::value == dyn, "");
    static_assert(static_extent<0, 33, dyn, 19>::value == 33, "");
}

我已经在godbolt 上对其进行了测试,它似乎可以与 clang 一起使用。不幸的是,我被绑定到 gcc,它给了我一个 ICE 和一个堆栈跟踪。我试图在他们的bugzilla 上冲浪,我有点迷路了。

是否值得为主干版本提交错误报告?它甚至想要吗? 有人知道这是否已经是一个已知问题吗? 我查找了关键字“ice”,但在那里找不到任何有用的东西。

【问题讨论】:

  • “是否值得为主干版本提交错误报告?是否需要?”我会说,是的 - 可能比任何其他版本都更重要版本!
  • 看来只有登录后才能搜索 bugzilla,而且由于垃圾邮件,目前不允许使用新帐户。因此,除非有人为您提交此错误,否则您将不走运。
  • 好吧,我想它现在可能在 bugzilla 中。我今天检查了,我相信今天有一个提交也可能触及我的问题。 gcc.gnu.org/bugzilla/show_bug.cgi?id=79549

标签: c++ gcc c++17 bug-reporting


【解决方案1】:

是的,应报告所有 ICE。

我已经为你打开了https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79556。

谢谢。

【讨论】:

  • 谢谢。我写了一封电子邮件来获取一个帐户并访问错误报告。还没有答案...我有更多的 ICE,我可以提供。我使用 Concepts 进行了很多开发,但我时常看到错误。
【解决方案2】:

我想为所有找到你问题的读者回答:

  • 是的,非常感谢您提交中继的错误报告。与发布后相比,在开发阶段修复错误要容易得多。
  • 是的,需要。如果 bug 或回归是在几天或几周前引入的,那么更改仍然存在并且不太难修复。

你应该怎么做?

  • 尝试使用最新版本的 trunk 或尽可能新的版本。
  • 重新编译您的代码并添加-save-temps。这将生成一个 .i(对于 C,它将是 .ii 对于 C++)文件。
  • 使用与上述相同的标志进行编译,但使用 .i/.ii 文件检查问题是否仍然存在。
  • 在 gcc.gnu.org/bugzilla/ 上发布错误,包括错误消息、GCC 版本 (gcc - v),并附上您的 .i/-ii 文件。

顺便说一下,LLVM/Clang 的工作方式类似:https://releases.llvm.org/1.9/docs/HowToSubmitABug.html

进一步阅读:

【讨论】:

    猜你喜欢
    • 2014-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-18
    • 2017-10-13
    相关资源
    最近更新 更多