gcc/testsuite/g++.dg/eh/crash2.C
raw| 1 | // PR c++/97187 |
| 2 | // { dg-do compile { target c++14 } } |
| 3 | // { dg-options "-fno-exceptions" } |
| 4 | |
| 5 | auto yp = [] { return 0; }; |
| 6 | |
| 7 | template <class DI> |
| 8 | DI |
| 9 | zl () |
| 10 | { |
| 11 | auto au = [] () -> DI { return *new auto (true ? yp : throw); }; // { dg-error "exception handling disabled" } |
| 12 | |
| 13 | return au (); |
| 14 | } |
| 15 | |
| 16 | auto |
| 17 | vd () |
| 18 | { |
| 19 | return zl <decltype (yp)> (); |
| 20 | } |