https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122646
Bug ID: 122646
Summary: Estrange interaction between the global module
fragment and zip_view
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: alberto.gcc.bugzilla at gmail dot com
Target Milestone: ---
Hello
This example:
``` M.cpp
module;
#include <vector>
export module M;
import std;
export
template<typename>
struct T
{
static void foo(int n)
{
std::vector<int> u(n);
std::vector<double> v(3 * n);
for (auto &&bar : std::views::zip(u, v | std::views::chunk(3u))) ;
}
};
```
``` main.cpp
import M;
int main()
{
T<int>::foo(10);
}
```
compiled with:
../gcc-16/gcc-16/bin/g++ -O3 -std=c++23 -fmodules -fsearch-include-path
-fmodule-only -c bits/std.cc
../gcc-16/gcc-16/bin/g++ -O3 -std=c++23 -fmodules M.cpp main.cpp -o foo
results in a wall of errors involving zip_view comparison operators.
It is very inconsistent; this is the shortest example I could come up with.
Slight variations can make the error go away, or throw a different (albeit
related, I think) diagnostic.
$ /home/alberto/gcc-16/gcc-16/bin/g++ -v
Usando especificaciones internas.
COLLECT_GCC=/home/alberto/gcc-16/gcc-16/bin/g++
COLLECT_LTO_WRAPPER=/home/alberto/gcc-16/gcc-16/libexec/gcc/x86_64-pc-linux-gnu/16.0.0/lto-wrapper
Objetivo: x86_64-pc-linux-gnu
Configurado con: ../gcc/configure --enable-languages=c++ --disable-multilib
--disable-bootstrap --prefix=/home/alberto/gcc-16/gcc-16/
Modelo de hilos: posix
Algoritmos de compresión LTO admitidos: zlib zstd
gcc versión 16.0.0 20251107 (experimental) (GCC)