The following code crashes deep inside the standard library:
#include <set>
#include <vector>
struct Parent
{
std::set<int> v;
};
struct Child : public Parent
{
Child() = default;
};
int main()
{
std::vector<Child> v{ {} };
}
but if the constructor is explicitly declared (without = default), it doesn't crash. I don't understand why. I'm using VS2019.
I looked up into the code and it really caused to happen in Visual Studio 16.7.7. Now it seems to be working fine in both in VS 16.8.3 and g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 (tried with -std=c++14), it was a bug which seems to be fixed by Microsoft team in the recent update.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With