Hi Nikolay,
As far as I understand it, there is no bug here. The statement:
throw;
(throw without arguments) can only be used inside a catch block to re-throw an already thrown (and catched) exception. For example:
try
{
// some code that throws an exception
throw "foo";
}
catch ( ... ) // catch any exception
{
std::cout << "I've caught something, but I don't bother to know what it is at this point...\n";
throw; // re-throw the exception
}
When you re-throw an exception as above, it is forwarded to an outer try/catch level, if it exists, or otherwise it is treated as a regular uncaught exception.
So you can't use throw; out of the scope of a catch construct.