]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Do not include internal headers in tests
authorJonathan Wakely <jwakely@redhat.com>
Wed, 29 Oct 2025 15:28:52 +0000 (15:28 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 29 Oct 2025 17:22:39 +0000 (17:22 +0000)
For 42319.cc the PR says that <ios> reproduced the problem, so let's
include that instead. We should also use the no_pch option because
otherwise the test is including everything anyway, and so fails to check
that the char_traits.h header can be included in isolation. There's also
no reason to use an explicit -std=gnu++11 option, we can test it for all
modes instead.

For the thread test there's no reason to use <bits/move.h> instead of
the correct header for std::move.

libstdc++-v3/ChangeLog:

* testsuite/17_intro/headers/c++2011/42319.cc: Include <ios>
instead of <bits/char_traits.h>. Add no_pch option. Remove
explicit -std=gnu++11 option.
* testsuite/30_threads/thread/swap/1.cc: Include <utility>
instead of <bits/move.h>.

libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc
libstdc++-v3/testsuite/30_threads/thread/swap/1.cc

index cd576cad297987e6f4978f3e3d95a60c29e18e1e..350a5481dbd46dd8930e3db59e0b7903f2d91221 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-add-options no_pch }
 
 // Copyright (C) 2009-2025 Free Software Foundation, Inc.
 //
@@ -19,4 +19,4 @@
 // <http://www.gnu.org/licenses/>.
 
 // libstdc++/42319
-#include <bits/char_traits.h>
+#include <ios>
index 9616b150d24051c4bf7c0508c1c38658ed878793..b1fde096e67d860c35fe114b680d234d35bac782 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <thread>
 #include <system_error>
-#include <bits/move.h> // std::move
+#include <utility> // std::move
 #include <testsuite_hooks.h>
 
 void f() { }