Real World Code projects still using `complex<NonFloating>`
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C++
- Star
- 11.2k
- Fork
- 1.7k
- Merge trung bình
- 4 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/STL
-
LWG
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 2 ngày
-
generator LWG
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
LWG
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
`<__msvc_math.hpp>`: `_USE_MATH_DEFINES` is ignored after the first `<math.h>` include under `/Zc:cmath`Có thể đã có người làm @tiagomacarios đã nhận 10 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/STL
Issue tương tự
-
bug data-types
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 71/100
ClickHouse/clickhouse-odbc#680 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ionut-mihalache/aqua#31 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-kind
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
villagesql/villagesql-server#1702 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/vcpkg-tool#2191 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày