Closed frederick-vs-ja closed 23 hours ago
The following program doesn't compile with MSVC STL.
#include <cstdint> #include <algorithm> #include <ranges> constinit int a[]{42, 1729}; constinit auto viewmax = std::views::iota(std::uintmax_t{}, std::uintmax_t{}) | std::views::transform([] (std::uintmax_t i) -> int& { return a[i]; }); int main() { std::ranges::stable_sort(viewmax); }
The errors are probably caused by adding integer-class value to pointer, which is not supported.
https://godbolt.org/z/q5vdzzMqK
The program compiles.
Every version shipping integer-class types (_Signed128/_Unsigned128).
_Signed128
_Unsigned128
The program used to compile in VS 16.10 which didn't have integer-class types (Godbolt link).
Oops, this is duplicate of #2885.
Describe the bug
The following program doesn't compile with MSVC STL.
The errors are probably caused by adding integer-class value to pointer, which is not supported.
Command-line test case
https://godbolt.org/z/q5vdzzMqK
Expected behavior
The program compiles.
STL version
Every version shipping integer-class types (
_Signed128
/_Unsigned128
).The program used to compile in VS 16.10 which didn't have integer-class types (Godbolt link).
Additional context