Comeau, g++ (ideone) and EDG accept the following code without diagnostic. Visual C++ compiles successfully, albeit with warning C4624.
class indestructible_bas
Well, if the automatically-generated constructor calls a possibly-throwing constructor, then it will give the same access error.
#include
class indestructible_base
{
~indestructible_base();
std::string s; // <------ this may throw
};
class T : indestructible_base
{
public:
//T() {}
};
int main(void) { new T(); }
So I guess exceptions is the answer. In ANSI ISO IEC 14882 the only noexcept(true)
string constructor is the move constructor. I believe this should compile but ideone says no.