Closed
Description
#include <array>
#include <ranges>
int main() {
constexpr auto v = std::array{1, 2, 3, 4, 5, 6};
for (auto const& [t0, t1, t2] : v | std::views::adjacent<3>) {
}
}
error: reference to local variable 'v' declared in enclosing function 'main'
Works in GCC 15.1
Error in clang 20.1.0
Works if you remove constexpr