Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Bug with {fmt} integration

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

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp
領域
testing

調査の方向性

ApprovalTests::FmtToString::toString から始め、報告された fmt::to_string の呼び出しが行われている箇所を確認し、<fmt/core.h> のみを使用して Compiler Explorer の例を再現します。fmt の include に関する integration の前提を確認してください。完了条件は、その header だけを include した状態で例がコンパイルでき、既存の formatting behavior が維持されることです。

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

説明

Integration with {fmt} has a problem if only <fmt/core.h> is included. Because it defines FMT_VERSION that triggers {fmt} integration, but does not provides fmt::to_string which is defined in <fmt/format.h>

https://godbolt.org/z/3WTE6f3b6

<source>: In static member function 'static std::string ApprovalTests::FmtToString::toString(const T&)':
<source>:1028:25: error: 'to_string' is not a member of 'fmt'; did you mean 'std::__cxx11::to_string'?
 1028 |             return fmt::to_string(printable);
      |                         ^~~~~~~~~
In file included from /opt/compiler-explorer/gcc-13.2.0/include/c++/13.2.0/string:54,
                 from /opt/compiler-explorer/gcc-13.2.0/include/c++/13.2.0/bits/locale_classes.h:40,
                 from /opt/compiler-explorer/gcc-13.2.0/include/c++/13.2.0/bits/ios_base.h:41,
                 from /opt/compiler-explorer/gcc-13.2.0/include/c++/13.2.0/streambuf:43,
                 from /opt/compiler-explorer/gcc-13.2.0/include/c++/13.2.0/bits/streambuf_iterator.h:35,
                 from /opt/compiler-explorer/gcc-13.2.0/include/c++/13.2.0/iterator:66,
                 from /opt/compiler-explorer/libs/fmt/10.1.1/include/fmt/core.h:14,
                 from <source>:1:
/opt/compiler-explorer/gcc-13.2.0/include/c++/13.2.0/bits/basic_string.h:4249:3: note: 'std::__cxx11::to_string' declared here
 4249 |   to_string(long double __val)
      |   ^~~~~~~~~
Compiler returned: 1
主要言語
C++
スター
342
フォーク
56
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

approvals/ApprovalTests.cpp のほかの issue

approvals/ApprovalTests.cpp の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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