libstdc++: Fix test that fails with -ffreestanding
commit94cc8e9d6f9f186d5fb1ca68fdf55e3c8090f3f6
authorJonathan Wakely <jwakely@redhat.com>
Thu, 9 Nov 2023 21:50:34 +0000 (9 21:50 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Sat, 11 Nov 2023 00:41:09 +0000 (11 00:41 +0000)
tree47c5d863a4dddff056fc2f79cd27e001508b0364
parent090589e84b04753a1bc99cdeeaadaf361555cb83
libstdc++: Fix test that fails with -ffreestanding

The -ffreestanding option disables Debug Mode, forcibly #undef'ing
_GLIBCXX_DEBUG. This means that the dangling checks in std::pair are
disabled for -ffreestanding in C++17 and earlier, because they depend on
_GLIBCXX_DEBUG. Adjust the target specifiers for the errors currently
matching c++17_down so they also require the hosted effective target.

libstdc++-v3/ChangeLog:

* testsuite/20_util/pair/dangling_ref.cc: Add hosted effective
target for specifiers using c++17_down.
libstdc++-v3/testsuite/20_util/pair/dangling_ref.cc