-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!
Description
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.
Lines 951 to 953 in 2e27f1f
| 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
#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 rejectedExpected behavior
The example should not compile.
STL version
Probably all existing versions since 48f79a3.
Additional context
This seemingly fits into
good first issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!