There is code
#include <array>
struct Foo {
int bar;
};
int main() {
constexpr auto v = std::array{Foo{}};
return 0;
}
While compile whith C++17:
fatal error C1001: Internal compiler error. ... (compiler file 'msc1.cpp', line 1591) INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\bin\HostX86\x86\CL.exe'
But this - compiles
#include <array>
struct Foo {
int bar;
};
int main() {
constexpr std::array<Foo, 1> v{Foo{}};
return 0;
}
All optimizations are disabled as described here
Is this a compiler bug?