Using the latest C++ MSVC 2019 and 2022 the following code hangs while compiling
#include <complex>
// const int N = 10000; // about 3 secs
// const int N = 40000; // about 40 secs
const int N = 200000; // hangs (over 10 min)
//const int N = 2000000; // normal, 1 sec
std::complex<double> x[N];
int main()
{
for (size_t i = 0; i < 200; i++)
x[i] = std::complex<double>(1,2);
}
Oddly, it compiles, at different speeds as shown including much larger sizes. Looks like a bug and I have reported it. Works fine if in a vector with the same sizes. Any idea what is causing this. Concern is that this may pop up elsewhere or produce bad compilations.