[libcxx-commits] [libcxx] [libc++][test] Include `<ios>` and `<ctime>` in `time_get_byname`/`time_put_byname` tests (PR #179986)
S. B. Tam via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Feb 5 08:59:34 PST 2026
https://github.com/cpplearner created https://github.com/llvm/llvm-project/pull/179986
These tests define a variable of type `std::ios` (which is an alias of `std::basic_ios<char>`). The standard says `std::basic_ios` is defined in `<ios>`.
Some of these tests do not include `<ctime>`, but they use the type `std::tm`.
This PR adds inclusion of `<ios>` and `<ctime>` to ensure that the definitions of `std::basic_ios` and `std::tm` are available in these tests.
>From 50e584da66c9e444cfe6bf9affd1d52fc1419de7 Mon Sep 17 00:00:00 2001
From: cpplearner <cpplearner at outlook.com>
Date: Fri, 6 Feb 2026 00:38:45 +0800
Subject: [PATCH] [libc++][test] Include `<ios>` in
`time_get_byname`/`time_put_byname` tests
---
.../category.time/locale.time.get.byname/get_date.pass.cpp | 1 +
.../locale.time.get.byname/get_date_wide.pass.cpp | 5 ++++-
.../locale.time.get.byname/get_monthname.pass.cpp | 1 +
.../locale.time.get.byname/get_monthname_wide.pass.cpp | 5 ++++-
.../category.time/locale.time.get.byname/get_one.pass.cpp | 1 +
.../locale.time.get.byname/get_one_wide.pass.cpp | 5 ++++-
.../locale.time.get.byname/get_weekday.pass.cpp | 1 +
.../locale.time.get.byname/get_weekday_wide.pass.cpp | 5 ++++-
.../category.time/locale.time.put.byname/put1.pass.cpp | 5 ++++-
9 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
index 3f53490c1baee..a0c0a869e4fbd 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
@@ -24,6 +24,7 @@
#include <cassert>
#include <ctime>
+#include <ios>
#include <locale>
#include "test_macros.h"
diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
index 3e20193d4af08..0b271efece686 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
@@ -24,8 +24,11 @@
// get_date(iter_type s, iter_type end, ios_base& str,
// ios_base::iostate& err, tm* t) const;
-#include <locale>
#include <cassert>
+#include <ctime>
+#include <ios>
+#include <locale>
+
#include "test_macros.h"
#include "test_iterators.h"
diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp
index fbffafc5bcee7..40f1a087567b2 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp
@@ -22,6 +22,7 @@
#include <cassert>
#include <ctime>
+#include <ios>
#include <locale>
#include "test_macros.h"
diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
index 54eff245d387d..cee793b1d5539 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
@@ -21,8 +21,11 @@
// get_monthname(iter_type s, iter_type end, ios_base& str,
// ios_base::iostate& err, tm* t) const;
-#include <locale>
#include <cassert>
+#include <ctime>
+#include <ios>
+#include <locale>
+
#include "test_macros.h"
#include "test_iterators.h"
diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp
index 513f92bc3fafd..03729ed68dc5c 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp
@@ -25,6 +25,7 @@
#include <cassert>
#include <ctime>
+#include <ios>
#include <locale>
#include "test_macros.h"
diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
index f3a09fe513731..84cc41817a163 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
@@ -25,8 +25,11 @@
// iter_type get(iter_type s, iter_type end, ios_base& f,
// ios_base::iostate& err, tm *t, char format, char modifier = 0) const;
-#include <locale>
#include <cassert>
+#include <ctime>
+#include <ios>
+#include <locale>
+
#include "test_macros.h"
#include "test_iterators.h"
diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
index 0df0b10c9d7ca..d5b880d6097eb 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
@@ -21,6 +21,7 @@
#include <cassert>
#include <ctime>
+#include <ios>
#include <locale>
#include "test_macros.h"
diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
index 2813c5dec568c..fb863ec3d1bc0 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
@@ -21,8 +21,11 @@
// get_weekday(iter_type s, iter_type end, ios_base& str,
// ios_base::iostate& err, tm* t) const;
-#include <locale>
#include <cassert>
+#include <ctime>
+#include <ios>
+#include <locale>
+
#include "test_macros.h"
#include "test_iterators.h"
diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
index a04cb2a0475bf..4900cf1945941 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
@@ -29,8 +29,11 @@
// ~time_put_byname();
// };
-#include <locale>
#include <cassert>
+#include <ctime>
+#include <ios>
+#include <locale>
+
#include "test_macros.h"
#include "test_iterators.h"
More information about the libcxx-commits
mailing list