gcc/testsuite/g++.dg/abi/pr98531-3.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | // { dg-additional-options -fno-use-cxa-atexit } |
| 3 | // PR 98531 Making __cxa_atexit (or atexit) more visible means it |
| 4 | // must be consistent with the std library's declarations |
| 5 | |
| 6 | extern "C" int atexit (void (*) (void)); |
| 7 | |
| 8 | struct C |
| 9 | { |
| 10 | ~C () noexcept; |
| 11 | C () noexcept; |
| 12 | }; |
| 13 | |
| 14 | C &frob () |
| 15 | { |
| 16 | static C c; // Requires atexit functionality |
| 17 | |
| 18 | return c; |
| 19 | } |
| 20 | |
| 21 |