I am wondering if it is possible to get clang format to have the following formatting for exception handling.
// Scenario 1: Catch and ignore exception
try
{
DoWork();
}
catch (const SomeException&) {}
// Scenario 2: Handle exception
try
{
DoWork();
}
catch (const SomeException& Exception)
{
// Code handling exception.
}
I have not been able to get scenario 1 formatting on a single line it prefers to put a new line before the { and then depending on SplitEmptyFunction will be:
// Scenario 1: Catch and ignore exception (SplitEmptyFunction is true)
try
{
DoWork();
}
catch (const SomeException&)
{}
// Scenario 1: Catch and ignore exception (SplitEmptyFunction is false)
try
{
DoWork();
}
catch (const SomeException&)
{
}
Have I missed a setting or is this just not possible?