-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed as not planned
Closed as not planned
Copy link
Labels
c++23clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"libstdc++GNU libstdc++ C++ standard libraryGNU libstdc++ C++ standard libraryobsoleteIssues with old (unsupported) versions of LLVMIssues with old (unsupported) versions of LLVM
Description
Hello! Compiling this example from cppreference works with GCC 13.2 but not Clang 17.0.1 using -std=c++23 flag. See comparison on godbolt.
#include <array>
#include <iostream>
#include <list>
#include <ranges>
#include <string>
#include <tuple>
#include <vector>
void print(auto const rem, auto const& range)
{
for (std::cout << rem; auto const& elem : range)
std::cout << elem << ' ';
std::cout << '\n';
}
int main()
{
auto x = std::vector{1, 2, 3, 4};
auto y = std::list<std::string>{"α", "β", "γ", "δ", "ε"};
auto z = std::array{'A', 'B', 'C', 'D', 'E', 'F'};
print("Source views:", "");
print("x: ", x);
print("y: ", y);
print("z: ", z);
print("\nzip(x,y,z):", "");
for (std::tuple<int&, std::string&, char&> elem : std::views::zip(x, y, z))
{
std::cout << std::get<0>(elem) << ' '
<< std::get<1>(elem) << ' '
<< std::get<2>(elem) << '\n';
std::get<char&>(elem) += ('a' - 'A'); // modifies the element of z
}
print("\nAfter modification, z: ", z);
}Metadata
Metadata
Assignees
Labels
c++23clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"libstdc++GNU libstdc++ C++ standard libraryGNU libstdc++ C++ standard libraryobsoleteIssues with old (unsupported) versions of LLVMIssues with old (unsupported) versions of LLVM
