https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121174
Bug ID: 121174
Summary: std::dextents was not found, which prevented
std::mdspan from specifying dimensions at runtime
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: printfne at gmail dot com
Target Milestone: ---
// main.cpp
import std;
int main() {
int v[] = {1, 2, 3, 4, 5, 6};
std::mdspan<int, std::dextents<std::size_t, 2>> view{v, 2, 3};
return 0;
}
// command
g++-latest -std=gnu++26 -c -fmodules -fsearch-include-path bits/std.cc
g++-latest -std=gnu++26 -fmodules main.cpp
// error message
ain.cpp: In function 'int main()':
main.cpp:7:27: error: 'dextents' is not a member of 'std'
7 | std::mdspan<int, std::dextents<std::size_t, 2>> view{v, 2, 3};
| ^~~~~~~~
main.cpp:7:49: error: template argument 2 is invalid
7 | std::mdspan<int, std::dextents<std::size_t, 2>> view{v, 2, 3};
| ^
main.cpp:7:49: error: template argument 3 is invalid
main.cpp:7:50: error: expected unqualified-id before '>' token
7 | std::mdspan<int, std::dextents<std::size_t, 2>> view{v, 2, 3};
|