[gcc r16-4713] libstdc++: Do not include internal headers in tests
Jonathan Wakely
redi@gcc.gnu.org
Wed Oct 29 17:22:49 GMT 2025
https://gcc.gnu.org/g:623cd25e688583b47014d08dc0519780afd381e4
commit r16-4713-g623cd25e688583b47014d08dc0519780afd381e4
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Wed Oct 29 15:28:52 2025 +0000
libstdc++: Do not include internal headers in tests
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>.
Diff:
---
libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc | 4 ++--
libstdc++-v3/testsuite/30_threads/thread/swap/1.cc | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc
index cd576cad2979..350a5481dbd4 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/42319.cc
@@ -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>
diff --git a/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc b/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc
index 9616b150d240..b1fde096e67d 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/swap/1.cc
@@ -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() { }
More information about the Libstdc++-cvs
mailing list