libstdc++-v3/testsuite/std/time/tzdb_list/pr118811.cc
raw| 1 | // { dg-do run { target c++20 } } |
| 2 | // { dg-require-effective-target tzdb } |
| 3 | // { dg-require-effective-target cxx11_abi } |
| 4 | // { dg-require-static-libstdcxx "" } |
| 5 | // { dg-additional-options "-static-libstdc++" } |
| 6 | |
| 7 | #include <chrono> |
| 8 | |
| 9 | struct Global |
| 10 | { |
| 11 | Global() |
| 12 | { |
| 13 | (void) std::chrono::current_zone(); // initialize tzdb on first use |
| 14 | } |
| 15 | |
| 16 | ~Global() |
| 17 | { |
| 18 | (void) std::chrono::current_zone(); // attempt to use it again on exit |
| 19 | } |
| 20 | |
| 21 | } global; |
| 22 | |
| 23 | int main() |
| 24 | { |
| 25 | } |