Describe the bug
As clarify by the NAD status of CWG-251, whenever the standard says "signed or unsigned integer type" or "standard integer type", only cv-unqualified versions are included.
So it's incorrect to use remove_cv_t<_Ty> here, and the original _Ty should be used instead.
|
template <class _Ty>
|
|
constexpr bool _Is_standard_integer = _Is_any_of_v<remove_cv_t<_Ty>, signed char, short, int, long, long long,
|
|
unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long>;
|
Currently, integer comparison functions in <utility> and std::extents (in <mdspan>) are affected.
Command-line test case
Godbolt link
#include <mdspan>
#include <utility>
static_assert(std::cmp_less<const int, const int>(0, 1)); // should be rejected
static_assert(sizeof(std::extents<const int, 42>)); // should be rejected
Expected behavior
The example should not compile.
STL version
Probably all existing versions since 48f79a3.
Additional context
This seemingly fits into
good first issue
Good for newcomers
to me.
Describe the bug
As clarify by the NAD status of CWG-251, whenever the standard says "signed or unsigned integer type" or "standard integer type", only cv-unqualified versions are included.
So it's incorrect to use
remove_cv_t<_Ty>here, and the original_Tyshould be used instead.STL/stl/inc/utility
Lines 951 to 953 in 2e27f1f
Currently, integer comparison functions in
<utility>andstd::extents(in<mdspan>) are affected.Command-line test case
Godbolt link
Expected behavior
The example should not compile.
STL version
Probably all existing versions since 48f79a3.
Additional context
This seemingly fits into good first issueGood for newcomers
to me.