Fix dangling else ambiguity, and make that warning a build-breaker...

... In this case, the ambiguity resolution was correct for the intent, but
we shouldn't rely on that.
This commit is contained in:
Paul Licameli 2020-09-22 13:10:26 -04:00
parent fcdb9e7a3a
commit c478e12b48
2 changed files with 3 additions and 1 deletions

View File

@ -72,7 +72,7 @@ void MessageBoxException::DelayedHandlerAction()
// common cause such as exhaustion of disk space so that the others
// give the user no useful added information.
if ( wxAtomicDec( sOutstandingMessages ) == 0 )
if ( wxAtomicDec( sOutstandingMessages ) == 0 ) {
if (ErrorHelpUrl().IsEmpty())
{
::AudacityMessageBox(
@ -89,6 +89,7 @@ void MessageBoxException::DelayedHandlerAction()
ErrorMessage(),
ErrorHelpUrl());
}
}
moved = true;
}

View File

@ -1020,6 +1020,7 @@ list( APPEND OPTIONS
$<$<CXX_COMPILER_ID:MSVC>:/permissive->
$<$<CXX_COMPILER_ID:AppleClang,Clang>:-Wno-underaligned-exception-object>
$<$<CXX_COMPILER_ID:AppleClang,Clang>:-Werror=return-type>
$<$<CXX_COMPILER_ID:AppleClang,Clang>:-Werror=dangling-else>
)
list( APPEND LDFLAGS