workaround clang-14 bug
[LibreOffice.git] / external / cppunit / propagate-exceptions.patch.0
blobdd9a6b32c54287818bbfb70cd9dae1852f8c0d20
1 --- src/cppunit/TestResult.cpp
2 +++ src/cppunit/TestResult.cpp
3 @@ -5,6 +5,7 @@
4  #include <cppunit/tools/Algorithm.h>
5  #include <cppunit/portability/Stream.h>
6  #include <algorithm>
7 +#include <cstdlib>
8  #include "DefaultProtector.h"
9  #include "ProtectorChain.h"
10  #include "ProtectorContext.h"
11 @@ -18,7 +19,8 @@
12      , m_protectorChain( new ProtectorChain )
13      , m_stop( false )
14  { 
15 -  m_protectorChain->push( new DefaultProtector() );
16 +  if (!std::getenv("CPPUNIT_PROPAGATE_EXCEPTIONS"))
17 +    m_protectorChain->push( new DefaultProtector() );
18  }