Skip to content

[libc++] Remove invalid char_traits instantiations from a test #142016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented May 29, 2025

We had a test which created invalid char_traits instantiations for non-character types. This patch removes them.

We had a test which created invalid char_traits instantiations
for non-character types. This patch removes them.
@ldionne ldionne requested a review from a team as a code owner May 29, 2025 19:20
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label May 29, 2025
@llvmbot
Copy link
Member

llvmbot commented May 29, 2025

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

We had a test which created invalid char_traits instantiations for non-character types. This patch removes them.


Full diff: https://github.com/llvm/llvm-project/pull/142016.diff

1 Files Affected:

  • (modified) libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp (-15)
diff --git a/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp b/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp
index 1a28a5985a011..85fc5de128ceb 100644
--- a/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp
@@ -33,91 +33,76 @@ int main(int, char**)
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_ios<wchar_t>*       >();
 #endif
-    test<std::basic_ios<unsigned short>*>();
 
     test<std::basic_streambuf<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_streambuf<wchar_t>*       >();
 #endif
-    test<std::basic_streambuf<unsigned short>*>();
 
     test<std::basic_istream<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_istream<wchar_t>*       >();
 #endif
-    test<std::basic_istream<unsigned short>*>();
 
     test<std::basic_ostream<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_ostream<wchar_t>*       >();
 #endif
-    test<std::basic_ostream<unsigned short>*>();
 
     test<std::basic_iostream<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_iostream<wchar_t>*       >();
 #endif
-    test<std::basic_iostream<unsigned short>*>();
 
     test<std::basic_stringbuf<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_stringbuf<wchar_t>*       >();
 #endif
-    test<std::basic_stringbuf<unsigned short>*>();
 
     test<std::basic_istringstream<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_istringstream<wchar_t>*       >();
 #endif
-    test<std::basic_istringstream<unsigned short>*>();
 
     test<std::basic_ostringstream<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_ostringstream<wchar_t>*       >();
 #endif
-    test<std::basic_ostringstream<unsigned short>*>();
 
     test<std::basic_stringstream<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_stringstream<wchar_t>*       >();
 #endif
-    test<std::basic_stringstream<unsigned short>*>();
 
     test<std::basic_filebuf<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_filebuf<wchar_t>*       >();
 #endif
-    test<std::basic_filebuf<unsigned short>*>();
 
     test<std::basic_ifstream<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_ifstream<wchar_t>*       >();
 #endif
-    test<std::basic_ifstream<unsigned short>*>();
 
     test<std::basic_ofstream<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_ofstream<wchar_t>*       >();
 #endif
-    test<std::basic_ofstream<unsigned short>*>();
 
     test<std::basic_fstream<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_fstream<wchar_t>*       >();
 #endif
-    test<std::basic_fstream<unsigned short>*>();
 
     test<std::istreambuf_iterator<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::istreambuf_iterator<wchar_t>*       >();
 #endif
-    test<std::istreambuf_iterator<unsigned short>*>();
 
     test<std::ostreambuf_iterator<char>*          >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::ostreambuf_iterator<wchar_t>*       >();
 #endif
-    test<std::ostreambuf_iterator<unsigned short>*>();
 
     test<std::ios* >();
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS

Copy link
Contributor

@frederick-vs-ja frederick-vs-ja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specializations for unsigned short look quite MSVC-ish, but they seemed existing since the initial commit.
I think it's perfectly fine to remove them. Even when testing non-conforming mode of MSVC (wchar_t being unsigned short), the coverage should have been complete.

@ldionne ldionne merged commit d0fb835 into llvm:main Jun 3, 2025
187 of 207 checks passed
@ldionne ldionne deleted the review/remove-invalid-char-traits-instantiations branch June 3, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants