I have the following file: Testing2.cpp:
#include <string>
#include <iostream>
int main() {
std::string ss = "aaaa";
ss += "aa";
std::cout << ss << "\n";
}
When I compile it like this: g++-11 -o Testing2 Testing2.cpp -std=c++20, I get the
desired output. When I compile it like this: g++-11 -o Testing2 Testing2.cpp -std=c++20 -fmodules-ts, I get a runtime segmentaion fault error.
Question 1: Is this a bug in g++, or am I missing something?
I had several similar issues, one with std::filesystem, one with std::map.
The code will not work properly, even if modules are not actually used.
Question 2: The above code does not even use modules. Why does g++ compile it differently when the ``-fmodules-ts``` is enabled from when it is not enabled?
Any insight is welcome.