This code used to work fine with Visual Studio 2015, but it not longer works with Visual Studio 2015 update 1.
class Foo
{
protected:
virtual ~Foo() {};
friend class Foo__init;
};
class Foo__init
{
public:
Foo _init;
};
static Foo__init _Foo_init;
It fails with the following error:
Error C2248 'Foo::~Foo': cannot access protected member declared in class 'Foo'
Is this a compiler bug or is the code ill formed?