diff options
Diffstat (limited to 'gcc-4.8/gcc/testsuite/g++.dg/eh/uncaught4.C')
-rw-r--r-- | gcc-4.8/gcc/testsuite/g++.dg/eh/uncaught4.C | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/g++.dg/eh/uncaught4.C b/gcc-4.8/gcc/testsuite/g++.dg/eh/uncaught4.C new file mode 100644 index 000000000..227d11b33 --- /dev/null +++ b/gcc-4.8/gcc/testsuite/g++.dg/eh/uncaught4.C @@ -0,0 +1,29 @@ +// PR c++/41174 +// { dg-do run } + +#include <exception> + +#define assert(E) if (!(E)) __builtin_abort(); + +struct e { + e() + { + assert( !std::uncaught_exception() ); + try { + throw 1; + } catch (int i) { + assert( !std::uncaught_exception() ); + throw; + } + } +}; + +int main() +{ + try { + throw e(); + } catch (int i) { + assert( !std::uncaught_exception() ); + } + assert( !std::uncaught_exception() ); +} |