gcc/testsuite/g++.dg/torture/pr46364.C
raw| 1 | // { dg-do compile } |
| 2 | // { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } } |
| 3 | #include <string> |
| 4 | |
| 5 | void a() |
| 6 | #if __cplusplus <= 201402L |
| 7 | throw (int) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } |
| 8 | #endif |
| 9 | ; |
| 10 | void b(std::string const &); |
| 11 | |
| 12 | void c(std::string *e) |
| 13 | { |
| 14 | b(""); |
| 15 | |
| 16 | try { |
| 17 | a(); |
| 18 | } catch (...) { |
| 19 | *e = ""; |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | void d() { |
| 24 | c(0); |
| 25 | } |