As of May of 2025 using GCC 12.2.0 this issue still persists. I also discovered this issue by accident and discovered, unwittingly, a useless work around that might shed more light on the problem for anyone hunting down the bug in gcc. Before finding this thread, and before knowing std::vector was the cause, I discovered that by commenting out all uses of std::vector
in a module being imported into main.cpp, not only could I compile successfully, but re-introducing the lines that used std::vector
and re-attempting to compile would also succeed and the output program would work just fine. I have no idea why and it makes zero sense.