REQUIRE(std::indirect(42) == 42) fails to compile with gcc and clang

オープン
#3,073 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@akasakariko がすでに取り組んでいます。

2026年10月26日 から。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
cpp
領域
testing-qa

調査の方向性

Compiler Explorer で提供されたテストスニペットから始め、x86-64 GCC trunk と Clang trunk を -std=c++26 とともに使用して、再帰的な制約充足エラーを再現します。REQUIRE に関係する Catch2 の式処理を追跡し、テストが std::indirect(42) == 42 でコンパイルおよびパスした時点で完了を確認します。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug
Using Catch2 with REQUIRE(std::indirect(42) == 42) triggers a recursive constraint satisfaction error with gcc and clang.

error: satisfaction of atomic constraint 'requires(const _Tp& __t, const _Up& __u) {__t == __u;} [with _Tp = _Tp; _Up = _Up]' depends on itself

Expected behavior
REQUIRE(std::indirect(42) == 42) should compile and pass.

Reproduction steps
Build this snippet with x86-64 gcc trunk and -std=c++26

#include <catch2/catch_all.hpp>
#include <memory>

TEST_CASE( "std::indirect(42) compares equal to 42" ) {
    REQUIRE(std::indirect(42) == 42);
}

Platform information:

  • OS: Compiler Explorer
  • Compiler+version: x86-64 gcc trunk and x86-64 clang trunk
  • Catch version: Tested with trunk and 3.0.1
主要言語
C++
スター
21.6k
フォーク
3.4k
平均マージ
3日 12時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

catchorg/Catch2 のほかの issue

catchorg/Catch2 の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。