Real World Code projects still using `complex<NonFloating>`
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- cpp
- 領域
- testing-qa
調査の方向性
Start with the listed RWC source locations, especially the mlpack error trace at lars_impl.hpp:672, and validate affected projects using headers with the attempted removal. The issue asks contributors to report and fix upstream uses of complex<NonFloating>; its checklist identifies dlib, ITK, fmt, mp-units/blaze, Eigen, MLPack, Root, and Tensorflow. Done means affected uses are fixed or confirmed absent upstream, with each project checked against the modified headers.
索引モデルが issue の本文から書いたものです。
説明
We deprecated complex<NonFloating> with #2759. We tried to remove it with #5984, but it had to be restored by #6524.
A bunch of projects in our Real World Code (RWC) test suite were using complex<NonFloating> despite our years of deprecation warnings. If we can get these issues reported upstream and fixed, we can consider attempting removal again (this time possibly with an escape hatch).
The following should be an exhaustive list of affected RWC projects. It is NOT an exhaustive list of breaks. Each project should ideally be validated with modified headers containing the attempted removal.
- Boost, fixed 2026-11-14: boostorg/container_hash#44
- dlib: https://github.com/davisking/dlib/blob/39b9dec21d1089b095528bd399d3808d80c3c300/dlib/test/matrix4.cpp#L814
- ITK: https://github.com/InsightSoftwareConsortium/ITK/blob/6fe4f6e6340c101d8422288536a0a80f5dfd7902/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_rational_traits.cxx#L15
- This is the commit that our RWC test suite is building as of 2026-11-16, captured on 2026-05-05. This file doesn't appear to be present in their latest sources, so it's unclear whether this has been fixed upstream or merely moved around.
- fmt: https://github.com/fmtlib/fmt/blob/0e72a3ecec32d46ea012914ea04856bdd343403a/test/std-test.cc#L90
- mp-units: https://github.com/mpusz/mp-units
- Via its usage (through conan) of blaze: https://bitbucket.org/blaze-lib/blaze/src/7a9086596e7783afb3cac0394bbc55d4c8b45a80/blaze/math/simd/BasicTypes.h?at=master#lines-213
- Eigen: https://gitlab.com/libeigen/eigen/-/blob/8d4a5a844cc052f0a17952e0fd5e4987ceb96e24/test/type_test_helpers.h#L123
- MLPack: https://github.com/mlpack/mlpack/blob/c3e9f343325ff63e8ea11b9d5047d35965f48d4f/src/mlpack/methods/lars/lars_impl.hpp#L672
- According to Copilot when given the error message below, the issue is that MLPack is using a library called Armadillo. Here, the right operand to
operator+isarma::uvecwhosepod_typeisarma::uword, which isuint64_t. Template argument deduction runs for anoperator+(const std::complex<typename T1::pod_type>& k, const T1& X)which then formscomplex<uint64_t>, which we've made into a hard error: https://gitlab.com/armadillo-lib/armadillo-code/-/blob/15.6.x/include/armadillo_bits/operator_plus.hpp?ref_type=heads#L89-101
- According to Copilot when given the error message below, the issue is that MLPack is using a library called Armadillo. Here, the right operand to
- Root: https://github.com/root-project/root/blob/8864fbbc9df0cddbc85e3d42cafcce9a467292a5/core/clingutils/inc/root_std_complex.h#L25
- Tensorflow: https://github.com/tensorflow/tensorflow/blob/19a9efb077226f58c78cff2454ea9508d7381fdd/tensorflow/lite/kernels/elementwise.cc#L251
- Here, the problem is that
std::abs<int32_t>(static_cast<int32_t>(in_data[i]))is trying to Help The Compiler with an explicit template argument tostd::abs(which is completely pointless as thestatic_castalready selectsint32_t). This ends up considering thestd::absforstd::complex, forming astd::complex<int32_t>. Oopsy! The fix is trivial (although morestd::abscalls may be affected).
- Here, the problem is that
Click to expand MLPack error:
C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Tools\MSVC\14.52.37025\include\complex(366,19): error C2338: static assertion failed: 'N5054 [complex.numbers.general]/2: "The effect of instantiating the primary template of complex for any type that is not a cv-unqualified floating-point type is unspecified." This implementation forbids such instantiations.' [C:\gitP\mlpack\mlpack\build_amd64\src\mlpack\methods\mlpack_lars.vcxproj]
(compiling source file '../../../../src/mlpack/methods/lars/lars_main.cpp')
C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Tools\MSVC\14.52.37025\include\complex(366,19):
the template instantiation context (the oldest one first) is
C:\gitP\mlpack\mlpack\src\mlpack\methods\lars\lars_main.cpp(180,11):
see reference to function template instantiation or specialization 'double mlpack::LARS<arma::mat>::Train<arma::mat>(const MatType &,const arma::rowvec &,const bool)' being compiled
with
[
MatType=arma::mat
]
C:\gitP\mlpack\mlpack\src\mlpack\methods\lars\lars_main.cpp(180,16):
see the first reference to 'mlpack::LARS<arma::mat>::Train' in 'lars'
C:\gitP\mlpack\mlpack\src\mlpack\methods\lars\lars_impl.hpp(269,10):
see reference to function template instantiation or specialization 'double mlpack::LARS<arma::mat>::Train<MatType,arma::rowvec,void,void>(const MatType &,const ResponsesType &,const bool,const bool,const double,const double,const double,const bool,const bool)' being compiled
with
[
MatType=arma::mat,
ResponsesType=arma::rowvec
]
C:\gitP\mlpack\mlpack\src\mlpack\methods\lars\lars_impl.hpp(672,23):
see reference to class template instantiation 'std::complex<unsigned __int64>' being compiled
- 主要言語
- C++
- スター
- 11.2k
- フォーク
- 1.7k
- 平均マージ
- 4日 4時間
- マージ済み PR(30日)
- 14
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/STL のほかの issue
-
LWG
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 2 日以内に返信
-
generator LWG
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
LWG
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
`<__msvc_math.hpp>`: `_USE_MATH_DEFINES` is ignored after the first `<math.h>` include under `/Zc:cmath`対応中かも @tiagomacarios が 10 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
bug data-types
難易度 2/5 1〜3時間 初心者へのやさしさ 71/100
ClickHouse/clickhouse-odbc#680 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ionut-mihalache/aqua#31 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
needs-kind
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
villagesql/villagesql-server#1702 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/vcpkg-tool#2191 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信