]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Explicitly pass -Wsystem-headers in tests that need it
authorPatrick Palka <ppalka@redhat.com>
Wed, 17 Sep 2025 01:00:50 +0000 (21:00 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 1 Oct 2025 14:09:01 +0000 (10:09 -0400)
commit9c3777e9619ad3e776870843d248b7fc4d8c80ed
treef6ea33d63d7f370b7fbe3715c4b97908fba9202e
parent8c2cd0911719605f648a221f536c8a2c0e611118
libstdc++: Explicitly pass -Wsystem-headers in tests that need it

When running libstdc++ tests using an installed gcc (as opposed to an
in-tree gcc), we naturally use system stdlib headers instead of the
in-tree headers.  But warnings from within system headers are suppressed
by default, so tests that check for such warnings spuriously fail in such
a setup.  This patch makes us compile such tests with -Wsystem-headers so
that they consistently pass.

libstdc++-v3/ChangeLog:

* testsuite/20_util/bind/dangling_ref.cc: Compile with
-Wsystem-headers.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.
* testsuite/29_atomics/atomic/operators/pointer_partial_void.cc:
Likewise.
* testsuite/30_threads/packaged_task/cons/dangling_ref.cc:
Likewise.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit e690b97761e18daccb4fff0151c97c1d0115b55f)
libstdc++-v3/testsuite/20_util/bind/dangling_ref.cc
libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic/operators/pointer_partial_void.cc
libstdc++-v3/testsuite/30_threads/packaged_task/cons/dangling_ref.cc